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.
31 lines
1.5 KiB
HTML
31 lines
1.5 KiB
HTML
{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, invalid=false, inline=false, small=false) %}
|
|
{%- if not invalid -%}
|
|
{% set _linkArgs = { pid:pdoc.pid|default(pdoc.docId) } %}
|
|
{% if tdoc %}{{ set(_linkArgs, 'query', {tid:tdoc.docId}) }}{% endif %}
|
|
{% if pdoc.domainId !== handler.domainId %}{{ set(_linkArgs, 'domainId', pdoc.domainId) }}{% endif %}
|
|
<a href="{{ url('problem_detail', _linkArgs) }}"{% if small %} data-tooltip="{{ pdoc.title }}"{% endif %}>
|
|
{%- endif -%}
|
|
{%- if pdoc.domainId !== handler.domainId -%}<b>{{ pdoc.domainId }}#</b>{%- endif -%}
|
|
<b>{{ pdoc.pid or 'P'+pdoc.docId if pdoc.domainId === handler.domainId else pdoc.docId }}</b>
|
|
{%- if not small -%} {{ pdoc.title }}{%- endif -%}
|
|
{%- if not invalid -%}
|
|
</a>
|
|
{%- endif -%}
|
|
{%- if pdoc.hidden and show_invisible_flag -%}
|
|
<span class="text-orange">({{ _('Hidden') }})</span>
|
|
{%- endif -%}
|
|
{%- if show_tags -%}{{ render_problem_tags(pdoc, inline=inline) }}{%- endif -%}
|
|
{% endmacro %}
|
|
|
|
{% macro render_problem_tags(pdoc, show_none_label=false, inline=false) %}
|
|
{%- if pdoc.tag|length > 0 %}
|
|
{%- if not inline %}<ul class="problem__tags">{% endif -%}
|
|
{%- for tag in pdoc['tag'] %}
|
|
<li class="problem__tag"><a class="problem__tag-link" href="{{ url('problem_category', category=tag) }}">{{ tag }}</a></li>
|
|
{%- endfor -%}
|
|
{%- if not inline %}</ul>{% endif -%}
|
|
{%- else -%}
|
|
{%- if show_none_label -%}{{ _('(None)') }}{%- endif -%}
|
|
{%- endif -%}
|
|
{% endmacro %}
|