{% macro _render_badge_form_button(regform, tpl, format='text', text='') %} {% set no_registrations = not regform.registrations|rejectattr('is_deleted')|list %} {% set no_registrations_msg %} {% trans %}Registration Form has no registrations{% endtrans %} {% endset %} {% if format == 'icon' %} {% else %} {% if no_registrations %} {{ text }} {% else %} {{ text }} {% endif %} {% endif %} {% endmacro %} {% macro _render_template(tpl, target, inherited=false, event=none) -%} {{ tpl.title }} {% if inherited %} {% if tpl.category.is_root %} {% trans %}Default template{% endtrans %} {% else %} {% trans title=tpl.category.title -%} from category "{{ title }}" {% endtrans %} {% endif %} {% endif %}
{% if not inherited %} {% endif %} {% if not inherited %} {%- endif %}
{% if tpl.type.name == 'poster' and event %} {% elif event %} {% set single_form = event.registration_forms|first if event.registration_forms|length == 1 %} {% if single_form %} {{ _render_badge_form_button(single_form, tpl, format='icon') }} {% else %} {% endif %} {% endif %}
{% endmacro -%} {% macro render_template_list(templates, target, inherited_templates=[], event=none) -%}

{% trans %}Inherited templates{% endtrans %}

{% for tpl in inherited_templates | sort(attribute='title') | sort(attribute='type') %} {{ _render_template(tpl, target, inherited=true, event=event) }} {% endfor %}

Custom templates

{% if templates %} {% for tpl in templates | sort(attribute='title') | sort(attribute='type') %} {{ _render_template(tpl, target, event=event) }} {% endfor %}
{% else %}
{% trans %}No templates{% endtrans %}
{% endif %}
{% endmacro -%}