ui: enhance problem_list

This commit is contained in:
undefined committed 2022-02-12 21:32:58 +08:00
1 parent 8dabcc3941
commit 43a1730c5c
8 files changed
+198 -36

No files matched your search

@@ -5,24 +5,16 @@
{% if pdoc.domainId !== handler.domainId %}{{ set(_linkArgs, 'domainId', pdoc.domainId) }}{% endif %}
<a href="{{ url('problem_detail', _linkArgs) }}"{% if small %} data-tooltip="{{ pdoc.title }}"{% endif %}>
{%- endif -%}
{%- if pdoc.domainId !== handler.domainId -%}
{{ pdoc.domainId }}#
{%- endif -%}
{%- if pdoc.pid -%}
{{ pdoc.pid }}
{%- else -%}
{{ 'P'+pdoc.docId if pdoc.domainId === handler.domainId else pdoc.docId }}
{%- endif -%}
{%- if not small -%}. {{ pdoc.title }}{%- endif -%}
{%- if pdoc.domainId !== handler.domainId -%}{{ pdoc.domainId }}#{%- endif -%}
<b>{{ pdoc.pid or 'P'+pdoc.docId if pdoc.domainId === handler.domainId else pdoc.docId }}</b>
{%- if not small -%}&nbsp;&nbsp;{{ pdoc.title }}{%- endif -%}
{%- if not invalid -%}
</a>
{%- endif -%}
{%- if pdoc.hidden and show_invisible_flag -%}
<span class="text-orange">({{ _('Hidden') }})</span>
{%- endif -%}
{%- if show_tags -%}
{{ render_problem_tags(pdoc, inline=inline) }}
{%- endif -%}
{%- if show_tags -%}{{ render_problem_tags(pdoc, inline=inline) }}{%- endif -%}
{% endmacro %}
{% macro render_problem_tags(pdoc, show_none_label=false, inline=false) %}
@@ -30,11 +22,9 @@
{%- if not inline %}<ul class="problem__tags">{% endif -%}
{%- for tag in pdoc['tag'] %}
<li class="problem__tag"><a class="problem__tag-link" href="{{ url('problem_category', category=tag) }}">{{ tag }}</a></li>
{%- endfor %}
{%- endfor -%}
{%- if not inline %}</ul>{% endif -%}
{%- else %}
{%- if show_none_label %}
{{ _('(None)') }}
{%- endif %}
{%- endif %}
{%- else -%}
{%- if show_none_label -%}{{ _('(None)') }}{%- endif -%}
{%- endif -%}
{% endmacro %}
@@ -1,13 +1,13 @@
{% macro render_status_td(rdoc, rid_key='_id', class='', allDomain = false) %}
{% macro render_status_td(rdoc, rid_key='_id', class='', allDomain=false, short=false) %}
<td class="col--status record-status--border {{ class }} {{ model.builtin.STATUS_CODES[rdoc.status] }}">
<div class="col--status__text">
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc.status] }}"></span>
<span style="color: {{ utils.status.getScoreColor(rdoc.score|default(0)) }}">{{ rdoc.score|default(0) }}</span>
<a
href="{{ url('record_detail', rid=rdoc[rid_key], domainId=rdoc.domainId) if allDomain else url('record_detail', rid=rdoc[rid_key]) }}"
class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.status] }}"
>
{{ model.builtin.STATUS_TEXTS[rdoc.status] }}
<span style="color: {{ utils.status.getScoreColor(rdoc.score|default(0)) }}">{{ rdoc.score|default(0) }}</span>
{{ model.builtin.STATUS_SHORT_TEXTS[rdoc.status] if short else model.builtin.STATUS_TEXTS[rdoc.status] }}
</a>
</div>
{% if rdoc.status == STATUS.STATUS_JUDGING %}
@@ -15,8 +15,7 @@
<col class="col--status edit-mode-hide">
{% endif %}
<col class="col--name">
<col class="col--tried">
<col class="col--ac">
<col class="col--ac-tried">
<col class="col--difficulty">
</colgroup>
<thead>
@@ -34,8 +33,7 @@
<span class="nojs--hide toggle-tag tag--hide">{{ _('Show tags') }}</span>
<span class="nojs--hide toggle-tag notag--hide">{{ _('Hide tags') }}</span>
</th>
<th class="col--tried">{{ _('Tried') }}</th>
<th class="col--ac">{{ _('AC') }}</th>
<th class="col--ac-tried">{{ _('AC') }} / {{ _('Tried') }}</th>
<th class="col--difficulty">{{ _('Difficulty') }}</th>
</tr>
</thead>
@@ -69,8 +67,7 @@
{% endif %}
{{ problem.render_problem_title(pdoc) }}
</td>
<td class="col--tried">{{ pdoc.nSubmit }}</td>
<td class="col--ac">{{ pdoc.nAccept }}</td>
<td class="col--ac-tried">{{ pdoc.nAccept }} / {{ pdoc.nSubmit }}</td>
<td class="col--difficulty">{{ pdoc['difficulty'] or lib.difficulty(pdoc.nSubmit, pdoc.nAccept) or _('(None)') }}</td>
</tr>
{%- endfor -%}