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 %}