mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Don’t show send/edit links for deleted template
Since you can’t really send or edit a deleted template we should show a message telling you that the template has been deleted. This is important because deleted templates still show up in the template statistics.
This commit is contained in:
@@ -16,15 +16,21 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="column-one-third">
|
||||
<div class="message-use-links{% if show_title %}-with-title{% endif %}">
|
||||
{% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']) %}
|
||||
<a href="{{ url_for(".send_messages", service_id=current_service.id, template_id=template.id) }}" class="primary">
|
||||
Send {{ 'text messages' if 'sms' == template.template_type else 'emails' }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %}
|
||||
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}">Edit template</a>
|
||||
{% endif %}
|
||||
<a href="{{ url_for(".send_from_api", service_id=current_service.id, template_id=template.id) }}">API info</a>
|
||||
</div>
|
||||
{% if template._template.archived %}
|
||||
<div class="message-updated-at">
|
||||
This template was deleted<br/>{{ template._template.updated_at|format_date_normal }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="message-use-links{% if show_title %}-with-title{% endif %}">
|
||||
{% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']) %}
|
||||
<a href="{{ url_for(".send_messages", service_id=current_service.id, template_id=template.id) }}" class="primary">
|
||||
Send {{ 'text messages' if 'sms' == template.template_type else 'emails' }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %}
|
||||
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}">Edit template</a>
|
||||
{% endif %}
|
||||
<a href="{{ url_for(".send_from_api", service_id=current_service.id, template_id=template.id) }}">API info</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user