Update Problem UI (Problem Information) (#94)

This commit is contained in:
Van Duc Le 2023-11-16 20:02:36 -06:00 committed by GitHub
parent 20f55047b8
commit 5cbf3489b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 48 deletions

View file

@ -416,3 +416,19 @@ ul.problem-list {
} }
} }
} }
.new-problem-info {
background-color: #fff6dd;
border-radius: 25px;
font-size: 14px;
height: 25px;
width: 100%;
display: table;
padding: 5px;
margin-top: 12px;
}
.info-block {
display:table-cell;
vertical-align:middle;
}

View file

@ -117,7 +117,6 @@
{% endfor %} {% endfor %}
</span> </span>
{% endif %} {% endif %}
<span class="spacer"></span> <span class="spacer"></span>
{% if has_render %} {% if has_render %}
<a href="{{ url('problem_pdf', problem.code) }}" class="view-pdf" target="_blank"> <a href="{{ url('problem_pdf', problem.code) }}" class="view-pdf" target="_blank">
@ -135,6 +134,7 @@
</div> </div>
{% endblock %} {% endblock %}
{% block info_float %} {% block info_float %}
{% if request.user.is_authenticated and request.in_contest_mode and submission_limit %} {% if request.user.is_authenticated and request.in_contest_mode and submission_limit %}
{% if submissions_left > 0 %} {% if submissions_left > 0 %}
@ -204,53 +204,6 @@
</div> </div>
{% endif %} {% endif %}
<hr style="padding-top: 0.3em">
<div class="problem-info-entry">
<i class="fa fa-check fa-fw"></i><span class="pi-name">{{ _('Points:') }}</span>
<span class="pi-value">
{% if contest_problem %}
{{ contest_problem.points }}{% if contest_problem.partial %} {{ _('(partial)') }}{% endif %}
{% else %}
{{ problem.points|floatformat }}{% if problem.partial %} {{ _('(partial)') }}{% endif %}
{% endif %}
</span>
</div>
<div class="problem-info-entry">
<i class="fa fa-clock-o fa-fw"></i><span class="pi-name">{{ _('Time limit:') }}</span>
<span class="pi-value">{{ problem.time_limit }}s</span>
</div>
<div class="problem-lang-limits">
{% for name, limit in problem.language_time_limit %}
<div class="lang-limit">
<span class="lang-name">{{ name }}</span>
<span class="lang-tl">{{ limit }}s</span>
</div>
{% endfor %}
</div>
<div class="problem-info-entry">
<i class="fa fa-server fa-fw"></i><span class="pi-name">{{ _('Memory limit:') }}</span>
<span class="pi-value">{{ problem.memory_limit|kbsimpleformat }}</span>
</div>
<div class="problem-lang-limits">
{% for name, limit in problem.language_memory_limit %}
<div class="lang-limit">
<span class="lang-name">{{ name }}</span>
<span class="lang-ml">{{ limit|kbsimpleformat }}</span>
</div>
{% endfor %}
</div>
<div class="problem-info-entry">
<i class="fa fa-file-o fa-fw"></i><span class="pi-name">{{ _('Input:') }}</span>
<span class="pi-value">
{{ fileio_input or _('stdin') }}
</span>
</div>
<div class="problem-info-entry">
<i class="fa fa-file fa-fw"></i><span class="pi-name">{{ _('Output:') }}</span>
<span class="pi-value">{{ fileio_output or _('stdout') }}</span>
</div>
<hr style="padding-top: 0.7em"> <hr style="padding-top: 0.7em">
{% cache 86400 'problem_authors' problem.id LANGUAGE_CODE %} {% cache 86400 'problem_authors' problem.id LANGUAGE_CODE %}
@ -342,6 +295,40 @@
</a> </a>
</div> </div>
{% endif %} {% endif %}
<div class = "new-problem-info center">
<span class="info-block">
<i class="fa fa-check fa-fw"></i><span class="pi-name">{{ _('Points:') }}</span>
<span class="new-pi-value">
{% if contest_problem %}
{{ contest_problem.points }}{% if contest_problem.partial %} {{ _('(partial)') }}{% endif %}
{% else %}
{{ problem.points|floatformat }}{% if problem.partial %} {{ _('(partial)') }}{% endif %}
{% endif %}
</span>
</span>
<span class="info-block">
<i class="fa fa-clock-o fa-fw"></i><span class="pi-name">{{ _('Time limit:') }}</span>
<span class="new-pi-value">{{ problem.time_limit }}s</span>
</span>
<span class="info-block">
<i class="fa fa-server fa-fw"></i><span class="pi-name">{{ _('Memory limit:') }}</span>
<span class="new-pi-value">{{ problem.memory_limit|kbsimpleformat }}</span>
</span>
<span class="info-block">
<i class="fa fa-file-o fa-fw"></i><span class="pi-name">{{ _('Input:') }}</span>
<span class="new-pi-value">
{{ fileio_input or _('stdin') }}
</span>
</span>
<span class="info-block">
<i class="fa fa-file fa-fw"></i><span class="pi-name">{{ _('Output:') }}</span>
<span class="new-pi-value">{{ fileio_output or _('stdout') }}</span>
</span>
</div>
{% cache 86400 'problem_html' problem.id MATH_ENGINE LANGUAGE_CODE %} {% cache 86400 'problem_html' problem.id MATH_ENGINE LANGUAGE_CODE %}
{{ description|markdown(lazy_load=True)|reference|str|safe }} {{ description|markdown(lazy_load=True)|reference|str|safe }}