core&ui: add contest/homework group filter (#589)

This commit is contained in:
panda authored and GitHub committed 2023-06-09 16:01:26 +08:00
1 parent 93bf79e6ad
commit 6f6bdee077
5 files changed
+47 -12

No files matched your search

@@ -60,10 +60,18 @@
<div class="section__tools">
<form method="get" name="filter-form">
{{ _('Show') }}:
{% if groups.length %}
<select class="inline compact select" name="group">
<option value=""{% if not group %} selected{% endif %}>{{ _('All') }}</option>
{%- for g in groups -%}
<option value="{{ g }}"{% if group == g %} selected{% endif %}>{{ g }}</option>
{%- endfor -%}
</select>
{% endif %}
<select class="inline compact select" name="rule">
<option value=""{% if not rule %} selected{% endif %}>{{ _('All') }}</option>
{%- for k, v in model.contest.RULES -%}
{% if k != 'homework' %}
{% if not k.hidden %}
<option value="{{ k }}"{% if rule == k %} selected{% endif %}>{{ _('All {0} Contests').format(v.TEXT) }}</option>
{% endif %}
{%- endfor -%}