mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-04 17:28:26 -04:00
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
{% from "components/folder-path.html" import folder_path, page_title_folder_path %}
|
||
{% from "components/pill.html" import pill %}
|
||
{% from "components/live-search.html" import live_search %}
|
||
{% from "components/form.html" import form_wrapper %}
|
||
{% from "components/page-header.html" import page_header %}
|
||
{% from "components/page-footer.html" import page_footer %}
|
||
|
||
{% extends "withnav_template.html" %}
|
||
|
||
{% set page_title = 'Templates' %}
|
||
|
||
{% block service_page_title %}
|
||
{{ page_title_folder_path(template_folder_path) }}
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
{% if (not current_service.all_templates) and (not current_service.all_template_folders) %}
|
||
|
||
{{ page_header(page_title, size='medium') }}
|
||
|
||
<p class="govuk-body">
|
||
Every message starts with a template. You can change it later.
|
||
{% if current_service.has_permission('broadcast') %}
|
||
You haven’t added any templates yet.
|
||
{% else %}
|
||
{% if current_user.has_permissions('manage_templates') %}
|
||
You need a template before you can
|
||
{% else %}
|
||
You need to ask your service manager to add templates before you can
|
||
{% endif %}
|
||
send emails, text messages or letters.
|
||
{% endif %}
|
||
</p>
|
||
|
||
{% else %}
|
||
|
||
<div class="govuk-grid-row">
|
||
<div class="{% if current_user.has_permissions('manage_templates') %} govuk-grid-column-five-sixths {% else %} govuk-grid-column-full {% endif %}">
|
||
<p class="govuk-body">
|
||
<br>
|
||
🚨 Every message starts with a template. To send, choose or create a template.
|
||
</p>
|
||
{{ folder_path(
|
||
folders=template_folder_path,
|
||
service_id=current_service.id,
|
||
template_type=template_type,
|
||
current_user=current_user
|
||
) }}
|
||
</div>
|
||
{% if current_user.has_permissions('manage_templates') and current_template_folder_id and user_has_template_folder_permission %}
|
||
<div class="govuk-grid-column-one-sixth">
|
||
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="govuk-link govuk-link--no-visited-state folder-heading-manage-link">Manage<span class="govuk-visually-hidden"> this folder</span></a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
{% if show_template_nav %}
|
||
<div class="bottom-gutter-2-3">
|
||
{{ pill(template_nav_items, current_value=template_type, show_count=False) }}
|
||
</div>
|
||
{% endif %}
|
||
|
||
{{ live_search(target_selector='#template-list .template-list-item', show=show_search_box, form=search_form) }}
|
||
|
||
{% if current_user.has_permissions('manage_templates') and user_has_template_folder_permission %}
|
||
{% call form_wrapper(
|
||
class='sticky-scroll-area',
|
||
module='template-folder-form',
|
||
data_kwargs={'prev-state': templates_and_folders_form.op or None}
|
||
) %}
|
||
{% include 'views/templates/_template_list.html' %}
|
||
{% include 'views/templates/_move_to.html' %}
|
||
{% endcall %}
|
||
|
||
{% else %}
|
||
{% include 'views/templates/_template_list.html' %}
|
||
{% endif %}
|
||
|
||
|
||
{% endblock %}
|