You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/templates/components/problem.html

39 lines
1.0 KiB
HTML

5 years ago
{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, rp=none, invalid=false) %}
{%- if not invalid %}
<a
5 years ago
{%- if tdoc %}
5 years ago
href="/c/{{ tdoc._id }}/p/{{ pdoc._id }}"
5 years ago
{%- else %}
href="/p/{{ pdoc.pid }}"
5 years ago
{%- endif %}
>
{%- endif %}
{{ pdoc['pid'] }} {{ pdoc['title'] }}
5 years ago
{%- if not invalid %}
</a>
{%- endif %}
{%- if pdoc['hidden'] and show_invisible_flag %}
<span class="text-orange">({{ _('Hidden') }})</span>
{%- endif %}
{%- if not rp is none %}
<span class="problem__rp-tag">RP+{{ rp|round|int }}</span>
{%- endif %}
{%- if show_tags %}
{{ render_problem_tags(pdoc) }}
{%- endif %}
{% endmacro %}
{% macro render_problem_tags(pdoc, show_none_label=false) %}
{%- if pdoc['tag']|length > 0 %}
<ul class="problem__tags">
{%- for tag in pdoc['tag'] %}
<li class="problem__tag"><a class="problem__tag-link" href="/p?category={{ tag }}">{{ tag }}</a></li>
5 years ago
{%- endfor %}
</ul>
{%- else %}
{%- if show_none_label %}
{{ _('(None)') }}
{%- endif %}
{%- endif %}
{% endmacro %}