{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, invalid=false, inline=false, small=false, alphabetic=false) %} {%- if not invalid -%} {% set _linkArgs = { pid:pdoc.pid|default(pdoc.docId) } %} {% if tdoc %}{{ set(_linkArgs, 'query', {tid:tdoc.docId}) }}{% endif %} {%- endif -%} {%- if pdoc.pid and pdoc.pid.includes('-') -%}{{ pdoc.pid.split('-')[0] }}#{%- endif -%} {%- if tdoc and alphabetic -%} {{ String.fromCharCode(65 + tdoc.pids.indexOf(pdoc.docId)) if tdoc.pids.includes(pdoc.docId) else '#' }} {%- else -%} {{ (pdoc.pid.split('-')[1] if pdoc.pid.includes('-') else pdoc.pid) if pdoc.pid else ('P'+pdoc.docId) }} {%- endif -%} {%- if not small -%} {{ pdoc.title }}{%- endif -%} {%- if not invalid -%} {%- endif -%} {%- if pdoc.hidden and show_invisible_flag -%} ({{ _('Hidden') }}) {%- 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 %}
{% endif -%} {%- else -%} {%- if show_none_label -%}{{ _('(None)') }}{%- endif -%} {%- endif -%} {% endmacro %}