Show problem code in the problem list

This commit is contained in:
thanhluong 2020-05-02 18:43:50 +00:00
parent 23ac7817f7
commit 982048e16a
2 changed files with 14 additions and 1 deletions

View file

@ -228,7 +228,7 @@ class ProblemAdmin(VersionAdmin):
return form return form
def save_model(self, request, obj, form, change): def save_model(self, request, obj, form, change):
super(ProblemAdmin, self).save_model(request, obj, form, change) super().save_model(request, obj, form, change)
if form.changed_data and any(f in form.changed_data for f in ('is_public', 'points', 'partial')): if form.changed_data and any(f in form.changed_data for f in ('is_public', 'points', 'partial')):
self._rescore(request, obj.id) self._rescore(request, obj.id)

View file

@ -204,6 +204,9 @@
<th class="solved"><i class="fa fa-check"></i></th> <th class="solved"><i class="fa fa-check"></i></th>
{% endif %} {% endif %}
<th class="problem">{{ _('Problem') }}</th> <th class="problem">{{ _('Problem') }}</th>
<!-- Luong begin -->
<th class="pcode">Problem code</th>
<!-- Luong end -->
<th class="category">{{ _('Category') }}</th> <th class="category">{{ _('Category') }}</th>
{% if show_types %} {% if show_types %}
<th>{{ _('Types') }}</th> <th>{{ _('Types') }}</th>
@ -220,6 +223,11 @@
<th class="problem"> <th class="problem">
<a href="{{ sort_links.name }}">{{ _('Problem') }}{{ sort_order.name }}</a> <a href="{{ sort_links.name }}">{{ _('Problem') }}{{ sort_order.name }}</a>
</th> </th>
<!-- Luong begin -->
<th class="pcode">
<a href="">Problem code</a>
</th>
<!-- Luong end -->
<th class="category"> <th class="category">
<a href="{{ sort_links.group }}">{{ _('Category') }}{{ sort_order.group }}</a> <a href="{{ sort_links.group }}">{{ _('Category') }}{{ sort_order.group }}</a>
</th> </th>
@ -277,6 +285,11 @@
<td class="problem"> <td class="problem">
<a href="{{ url('problem_detail', problem.code) }}">{{ problem.i18n_name }}</a> <a href="{{ url('problem_detail', problem.code) }}">{{ problem.i18n_name }}</a>
</td> </td>
<!-- Luong begin -->
<td class="pcode">
<a href="{{ url('problem_detail', problem.code) }}">{{ problem.code }}</a>
</td>
<!-- Luong end -->
<td class="category">{{ problem.group.full_name }}</td> <td class="category">{{ problem.group.full_name }}</td>
{% if show_types %} {% if show_types %}
<td class="types"> <td class="types">