mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Merge pull request #568 from alphagov/template_history_view
Template history view
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
{% if created_at %}{{ created_at }}{% endif %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
<div class="email-message">
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
{% if created_at %}{{ created_at }}{% endif %}
|
||||
</h3>
|
||||
{% endif %}
|
||||
{% if recipient is not none %}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
{{ item.to }}
|
||||
</p>
|
||||
<p class="hint">
|
||||
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template.id) }}">{{ item.template.name }}</a>
|
||||
<a href="{{ url_for('.view_template_version', service_id=current_service.id, template_id=item.template.id, version=item.template_version) }}">{{ item.template.name }}</a>
|
||||
sent from
|
||||
{% if item.job %}
|
||||
<a href="{{ url_for(".view_job", service_id=current_service.id, job_id=item.job.id) }}">{{ item.job.original_file_name }}</a>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
{% 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('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">Template versions</a>
|
||||
<a href="{{ url_for(".send_from_api", service_id=current_service.id, template_id=template.id) }}">API info</a>
|
||||
</div>
|
||||
</div>
|
||||
40
app/templates/views/templates/_template_history.html
Normal file
40
app/templates/views/templates/_template_history.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{% from "components/email-message.html" import email_message %}
|
||||
{% from "components/sms-message.html" import sms_message %}
|
||||
|
||||
<div class="column-two-thirds">
|
||||
{% if 'email' == template.template_type %}
|
||||
{{ email_message(
|
||||
template.formatted_subject_as_markup,
|
||||
template.formatted_as_markup,
|
||||
name=template.name if show_title else None,
|
||||
edit_link=url_for(
|
||||
'.view_template_version',
|
||||
service_id=current_service.id,
|
||||
template_id=template.id,
|
||||
version=template.get_raw('version')
|
||||
)
|
||||
) }}
|
||||
{% elif 'sms' == template.template_type %}
|
||||
{{ sms_message(
|
||||
template.formatted_as_markup,
|
||||
name=template.name if show_title else None,
|
||||
edit_link=url_for(
|
||||
'.view_template_version',
|
||||
service_id=current_service.id,
|
||||
template_id=template.id,
|
||||
version=template.get_raw('version')
|
||||
)
|
||||
) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="column-one-third">
|
||||
<div class="sms-message-use-links{% if show_title %}-with-title{% endif %}">
|
||||
<p>Edited by {{ template.get_raw('created_by').name }}</p>
|
||||
<p>Created on {{ template.get_raw('created_at')|format_datetime }}</p>
|
||||
<p>Edited on
|
||||
{% if template.get_raw('updated_at') %}
|
||||
{{ template.get_raw('updated_at')|format_datetime }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
16
app/templates/views/templates/choose_history.html
Normal file
16
app/templates/views/templates/choose_history.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
{% block page_title %}
|
||||
{{ template.name }} – GOV.UK Notify
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
<h1 class="heading-large">{{ template.name }} version history</h1>
|
||||
<div class="grid-row">
|
||||
{% for template in versions %}
|
||||
{% with show_title=True %}
|
||||
{% include 'views/templates/_template_history.html' %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
22
app/templates/views/templates/template_history.html
Normal file
22
app/templates/views/templates/template_history.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/email-message.html" import email_message %}
|
||||
{% from "components/sms-message.html" import sms_message %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
|
||||
{% block page_title %}
|
||||
{{ template.name }} – GOV.UK Notify
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
|
||||
<h1 class="heading-large">{{ template.name }}</h1>
|
||||
|
||||
<div class="grid-row">
|
||||
{% with show_title=False %}
|
||||
{% include 'views/templates/_template_history.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user