mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: add contest/homework group filter (#589)
This commit is contained in:
1 parent
93bf79e6ad
commit
6f6bdee077
5 files changed
+47
-12
No files matched your search
@@ -11,4 +11,7 @@ $highlight-button-color = #F6DF45
|
||||
|
||||
.homework__date
|
||||
margin-right: rem(10px)
|
||||
white-space: nowrap
|
||||
white-space: nowrap
|
||||
|
||||
.filter-form
|
||||
display: inline-block
|
||||
@@ -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 -%}
|
||||
|
||||
@@ -14,6 +14,20 @@
|
||||
<option value="list" selected>{{ _('List View') }}</option>
|
||||
</select>
|
||||
</span>
|
||||
{% if groups.length %}
|
||||
<form method="get" class="filter-form" name="filter-form">
|
||||
{{ _('Show') }}:
|
||||
<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>
|
||||
<button type="submit" class="compact button hasjs--hide">
|
||||
{{ _('Search') }}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_CREATE_HOMEWORK) %}
|
||||
<a class="compact button" href="{{ url('homework_create') }}">{{ _('Create Homework') }}</a>
|
||||
{% endif %}
|
||||
@@ -51,7 +65,7 @@
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
{{ paginator.render(page, tpcount) }}
|
||||
{{ paginator.render(page, tpcount, add_qs=qs) }}
|
||||
<div name="calendar_entry"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user