Caching and refactors

This commit is contained in:
cuom1999 2024-04-13 17:02:54 -05:00
parent 67b06d7856
commit 8f1c8d6c96
33 changed files with 485 additions and 381 deletions

View file

@ -260,21 +260,19 @@
<hr style="padding-top: 0.7em">
{% cache 86400 'problem_authors' problem.id LANGUAGE_CODE %}
{% with authors=problem.authors.all() %}
{% if authors %}
<div class="problem-info-entry">
<i class="fa fa-pencil-square-o fa-fw"></i><span
class="pi-name">{% trans trimmed count=authors|length %}
Author:
{% pluralize count %}
Authors:
{% endtrans %}</span>
<div class="pi-value authors-value">{{ link_users(authors) }}</div>
</div>
{% endif %}
{% endwith %}
{% endcache %}
{% with authors=problem.get_authors() %}
{% if authors %}
<div class="problem-info-entry">
<i class="fa fa-pencil-square-o fa-fw"></i><span
class="pi-name">{% trans trimmed count=authors|length %}
Author:
{% pluralize count %}
Authors:
{% endtrans %}</span>
<div class="pi-value authors-value">{{ link_users(authors) }}</div>
</div>
{% endif %}
{% endwith %}
{% if not contest_problem or not contest_problem.contest.hide_problem_tags %}
<div id="problem-types">