mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
It’s confusing to have one way of adding things when your service is new (green button) but a different way once you’ve added your first thing (the new grey buttons). For services that have a `edit_folders` permission, this commit standardises on the grey buttons for a consistent experience.
47 lines
2.2 KiB
HTML
47 lines
2.2 KiB
HTML
{% from "components/checkbox.html" import unlabelled_checkbox %}
|
|
{% from "components/message-count-label.html" import folder_contents_count, message_count_label %}
|
|
|
|
{% if template_list.template_folder_id and not template_list.templates_to_show %}
|
|
<p class="template-list-empty">
|
|
{% if template_list.folder_is_empty %}
|
|
This folder is empty
|
|
{% else %}
|
|
There are no {{ message_count_label(1, template_type, suffix='') }} templates in this folder
|
|
{% endif %}
|
|
</p>
|
|
{% else %}
|
|
<nav id=template-list>
|
|
{% for item in template_list %}
|
|
<div class="template-list-item {% if can_manage_folders %}template-list-item-with-checkbox{% endif %} {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
|
|
{% if can_manage_folders %}
|
|
{{ unlabelled_checkbox(
|
|
id='templates-or-folder-{}'.format(item.id),
|
|
name='templates_and_folders',
|
|
data=templates_and_folders_form.is_selected(item.id),
|
|
value=item.id,
|
|
) }}
|
|
{% endif %}
|
|
<h2 class="message-name {% if item.is_folder or (item.ancestors and not item.is_folder) %}template-list-folder{% endif %}">
|
|
{% for ancestor in item.ancestors %}
|
|
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=ancestor.id) }}">
|
|
{{ ancestor.name }}
|
|
</a> <span class="message-name-separator">/</span>
|
|
{% endfor %}
|
|
{% if item.is_folder %}
|
|
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=item.id) }}">
|
|
<span class="live-search-relevant">{{ item.name }}</span>
|
|
</a>
|
|
{% else %}
|
|
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}">
|
|
<span class="live-search-relevant">{{ item.name }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</h2>
|
|
<p class="message-type">
|
|
{{ item.hint }}
|
|
</p>
|
|
</div>
|
|
{% endfor %}
|
|
</nav>
|
|
{% endif %}
|