Files
notifications-admin/app/templates/views/templates/template.html
Chris Hill-Scott 60f9ea5f9c Hide template ID and redaction for broadcast templates
We’re not going to have an API for sending broadcasts at the moment, so
you don’t need the template ID for anything.

Broadcast also won’t contain personal information, or tokenised links,
etc, so there’s no need to redact them after sending.

Removing this things means the interface is less cluttered.
2020-07-08 15:49:32 +01:00

89 lines
3.5 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/folder-path.html" import folder_path, page_title_folder_path %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/textbox.html" import textbox %}
{% from "components/api-key.html" import api_key %}
{% from "components/button/macro.njk" import govukButton %}
{% block service_page_title %}
{{ page_title_folder_path(current_service.get_template_path(template._template)) }}
{% endblock %}
{% block maincolumn_content %}
{% if show_redaction_message %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous', subhead='Are you sure you want to hide personalisation after sending?') %}
<ul class="list list-bullet">
<li>
You will not be able to see personalised content in Notify for this template
</li>
<li>
You cannot undo this
</li>
</ul>
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
{{ govukButton({ "text": "Confirm", "classes": "govuk-button--warning govuk-!-margin-top-2" }) }}
</form>
{% endcall %}
</div>
{% else %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
{{ folder_path(
folders=current_service.get_template_path(template._template),
service_id=current_service.id,
template_type='all',
current_user=current_user
) }}
</div>
</div>
{% endif %}
<div class="govuk-grid-row">
{% include 'views/templates/_template.html' %}
</div>
{% if template.template_type != 'broadcast' %}
<div class="bottom-gutter-1-2">
{{ api_key(template.id, name="Template ID", thing='template ID') }}
</div>
{% endif %}
<div class="bottom-gutter-1-2">
{% if template._template.updated_at %}
<h2 class="heading-small bottom-gutter-2-3 heading-inline">
Last edited
<time class="timeago" datetime="{{ template._template.updated_at }}">
{{ template._template.updated_at|format_delta }}
</time>
</h2>
&emsp;
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
&emsp;
<br/>
{% endif %}
{% if current_user.has_permissions('manage_templates') and user_has_template_permission %}
{% if not template._template.archived %}
<span class="page-footer-delete-link page-footer-delete-link-without-button bottom-gutter-2-3">
<a class="govuk-link govuk-link--destructive" href="{{ url_for('.delete_service_template', service_id=current_service.id, template_id=template.id) }}">Delete this template</a>
</span>
&emsp;
{% endif %}
{% if template.template_type not in ('letter', 'broadcast') %}
{% if not template._template.redact_personalisation %}
<span class="page-footer-delete-link page-footer-delete-link-without-button">
<a class="govuk-link govuk-link--destructive" href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide personalisation after sending</a>
</span>
{% else %}
<p class="hint">Personalisation is hidden after sending</p>
{% endif %}
{% endif %}
{% endif %}
</div>
{% endblock %}