Put versions at bottom of single template page

Like the template ID this is an infrequently-used action on a template
and doesn’t belong at the same level as ‘Upload recipients’ or
‘Send yourself’ a test. We don’t think it’s information that’s useful to
working out which template you want to interact with, so it shouldn’t be
on the choose template page any more.
This commit is contained in:
Chris Hill-Scott
2017-03-16 16:25:47 +00:00
parent b908a38264
commit 89d3a116b9
4 changed files with 26 additions and 18 deletions

View File

@@ -39,6 +39,11 @@
margin-bottom: $gutter-half;
}
.bottom-gutter-1-3 {
@extend %bottom-gutter;
margin-bottom: $gutter/3;
}
.bottom-gutter-3-2 {
@extend %bottom-gutter;
margin-bottom: $gutter * 3/2;

View File

@@ -1,18 +1,16 @@
<div class="column-whole">
<h2 class="message-name">{{ template.name }}</h2>
<p class="hint">
{% if template.get_raw('version', 1) > 1 %}
Edit made {% if template.get_raw('updated_at', None) %}{{ template.get_raw('updated_at')|format_datetime_normal }}{% endif %}
{% else %}
Created
{% if template.get_raw('created_at', None) %}{{ template.get_raw('created_at')|format_datetime_normal }}{% endif %}
{% endif %}
by {{ template.get_raw('created_by').name }}
</p>
</div>
<div class="column-two-thirds">
<div class="column-whole">
{{ template|string }}
</div>
<div class="column-one-third">
<div class="message-use-links">
{% if template.get_raw('version', 1) > 1 %}
{% if template.get_raw('updated_at', None) %}{{ template.get_raw('updated_at')|format_datetime_normal }}{% endif %}
{% else %}
Created<br/>{% if template.get_raw('created_at', None) %}{{ template.get_raw('created_at')|format_datetime_normal }}{% endif %}
{% endif %}
<br/>by {{ template.get_raw('created_by').name }}
</div>
</div>

View File

@@ -64,12 +64,8 @@
<h2 class="message-name">
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=template.id) }}">{{ template.name }}</a>
</h2>
<p class="hint bottom-gutter-1-2">
<p class="hint bottom-gutter-1-3">
{{ message_count_label(1, template.template_type, suffix='')|capitalize }} template
{% if template.get('updated_at', None) %}
&emsp;Last edited {{ template.get('updated_at', None)|format_date_short }}
&emsp;<a href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
{% endif %}
</p>
</div>
{% endfor %}

View File

@@ -18,8 +18,17 @@
{% endwith %}
</div>
<div class="bottom-gutter-2">
<div class="bottom-gutter">
{{ api_key(template.id, name="Template ID", thing='template ID') }}
</div>
{% if template._template.updated_at %}
<div class="bottom-gutter-2">
<h2 class="heading-small">Last edited {{ template._template.updated_at|format_datetime_relative }}</h2>
<p>
<a href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
</p>
</div>
{% endif %}
{% endblock %}