add editorial column to problem table

This commit is contained in:
cuom1999 2020-06-15 13:46:43 -05:00
parent e00a64e49b
commit 3876896b97
3 changed files with 31 additions and 5 deletions

View file

@ -77,7 +77,7 @@
$('#go').click(clean_submit);
$('input#full_text, input#hide_solved, input#show_types').click(function () {
$('input#full_text, input#hide_solved, input#show_types, input#show_editorial').click(function () {
prep_form();
($('<form>').attr('action', window.location.pathname + '?' + $form.serialize())
.append($('<input>').attr('type', 'hidden').attr('name', 'csrfmiddlewaretoken')
@ -245,11 +245,16 @@
<th class="users">
<a href="{{ sort_links.user_count }}">{{ _('Users') }}{{ sort_order.user_count }}</a>
</th>
{% if show_editorial %}
<th class="editorial">
Editorial
</th>
{% endif %}
{% endif %}
</tr>
</thead>
<tbody>
{% for problem in problems %}
{% for problem in object_list %}
<tr>
{% if request.user.is_authenticated %}
{% if problem.id in completed_problem_ids %}
@ -311,6 +316,13 @@
{% endif %}
</a>
</td>
{% if show_editorial%}
<td class="editorial">
{% if problem.has_public_editorial %}
<a href="{{ url('problem_editorial', problem.code) }}">{{ _('Editorial') }}</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>

View file

@ -26,6 +26,11 @@
{% if show_types %} checked{% endif %}>
<label for="show_types">{{ _('Show problem types') }}</label>
</div>
<div>
<input id="show_editorial" type="checkbox" name="show_editorial" value="1"
{% if show_editorial %} checked{% endif %}>
<label for="show_editorial">{{ _('Show editorial') }}</label>
</div>
<div class="filter-form-group">
<label for="category"><i>{{ _('Category') }}</i></label>
<select id="category" name="category">