{% if not tags %} No tags exist yet. {% if change_permission %}
{% include "se/components/tag_action.html" with text="✏️ Create" href=create_tag_href %}
{% endif %} {% else %} {% if change_permission %}
{% include "se/components/tag_action.html" with text="📝 Edit" href=view_tags_href %}
{% include "se/components/tag_action.html" with text="✏️ Create" href=create_tag_href %}
{% endif %} Selected:
{% for tag in tags %} {% include "se/components/tag.html" with suffix="-edit" on_delete=tag.js_add_tag_onclick classes="tag-select" bold=True %} {% endfor %} {% include "se/components/tag_action.html" with id="clear_selected_tags" text="⨉ Clear" onclick="clear_tags()" %}

{% endif %}
{% for tag in root_tags %} {# one div per root tag to make the grid layout #}
{% for child in tag.descendants %}
{# this div makes sure the tag takes the full width of the grid layout's panel #} {% include "se/components/tag.html" with tag=child with_padding=True with_counters=True onclick=child.js_add_tag_onclick cursor_pointer=True %}
{% endfor %}
{% endfor %}