added manage_templates to enum

This commit is contained in:
Beverly Nguyen
2025-07-16 22:30:48 -07:00
parent 28f09674df
commit 126188cea1
10 changed files with 19 additions and 18 deletions

View File

@@ -16,7 +16,7 @@ Dashboard
<div class="dashboard margin-top-0 margin-bottom-2">
<h1 class="usa-sr-only">Dashboard</h1>
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) and not current_service.all_templates %}
{% include 'views/dashboard/write-first-messages.html' %}
{% endif %}

View File

@@ -8,7 +8,7 @@
<p class="hint">
This template was deleted {{ template._template.updated_at|format_datetime_relative }}.
</p>
{% elif not current_user.has_permissions(ServicePermission.SEND_MESSAGES, 'manage_api_keys', 'manage_templates', ServicePermission.MANAGE_SERVICE) or not user_has_template_permission %}
{% elif not current_user.has_permissions(ServicePermission.SEND_MESSAGES, 'manage_api_keys', ServicePermission.MANAGE_TEMPLATES, ServicePermission.MANAGE_SERVICE) or not user_has_template_permission %}
<p class="top-gutter-1-3 {% if template.template_type != 'sms' %}bottom-gutter{% endif %}">
If you need to send this
{{ 1|message_count_label(template.template_type, suffix='') }}
@@ -22,7 +22,7 @@
Use this template
</a>
{% endif %}
{% if current_user.has_permissions('manage_templates') %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="usa-button usa-button--outline usa-pill-separate-item">
Edit this template
</a>

View File

@@ -24,7 +24,7 @@
<nav id="template-list" aria-label="Template list">
{% set checkboxes_data = [] %}
{% if not current_user.has_permissions('manage_templates') %}
{% if not current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
<ul>
{% endif %}
@@ -94,7 +94,7 @@
} %}
{% set _ = checkboxes_data.append(checkbox_config) %}
{% if not current_user.has_permissions('manage_templates') %}
{% if not current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
<li
class="template-list-item {%- if item.ancestors %} template-list-item-hidden-by-default {%- else %} template-list-item-without-ancestors{%- endif %}">
{{ item_link_content }}
@@ -105,11 +105,11 @@
{% endif %}
{% endfor %}
{% if not current_user.has_permissions('manage_templates') %}
{% if not current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
</ul>
{% endif %}
{% if current_user.has_permissions('manage_templates') %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
{{ templates_and_folders_form.templates_and_folders(param_extensions={
"items": checkboxes_data,
"formGroup": False

View File

@@ -17,7 +17,7 @@
{% if not templates_and_folders.templates_to_show %}
{% if current_user.has_permissions('manage_templates') %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
<p class="bottom-gutter">
You need a template before you can send text messages.
</p>

View File

@@ -21,7 +21,7 @@
<p>
Every message starts with a template. You can change it later.
{% if current_user.has_permissions('manage_templates') %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %}
You need a template before you can
{% else %}
You need to ask your service manager to add templates before you can
@@ -33,7 +33,7 @@
<div class="grid-row flex-column">
<h1 class="font-body-2xl line-height-sans-2 margin-bottom-1 margin-top-0" id="page-title">{{page_title}}</h1>
<div class="{% if current_user.has_permissions('manage_templates') %} grid-col-10 {% else %} grid-col-12 {% endif %}">
<div class="{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %} grid-col-10 {% else %} grid-col-12 {% endif %}">
<p class="margin-top-0 margin-bottom-4" id="page-description">
Every message starts with a template. To send, choose or create a template.
</p>
@@ -44,7 +44,7 @@
current_user=current_user
) }}
</div>
{% if current_user.has_permissions('manage_templates') and current_template_folder_id and user_has_template_folder_permission %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) and current_template_folder_id and user_has_template_folder_permission %}
<div class="grid-col-2">
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="usa-link folder-heading-manage-link">Manage this folder<span class="usa-sr-only">Manage this folder</span></a>
</div>
@@ -63,7 +63,7 @@
<p class="usa-body margin-top-2">No templates found</p>
</div>
{% if current_user.has_permissions('manage_templates') and user_has_template_folder_permission %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) and user_has_template_folder_permission %}
{% call form_wrapper(
class='sticky-scroll-area',
module='template-folder-form',

View File

@@ -61,7 +61,7 @@
href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
</div>
{% endif %}
{% if current_user.has_permissions('manage_templates') and user_has_template_permission %}
{% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) and user_has_template_permission %}
<h2 class="margin-bottom-1 font-body-lg">More actions</h2>
<ul class="usa-list usa-list--unstyled">
{% if not template._template.archived %}