Stop users from editing/adding templates without the correct permission

If sending SMS is disabled for a service, it should not be possible to
add or modify SMS templates. If a user tries to do this, they should see
a different page with a link to go back. The same thing should happen
with email templates.
This commit is contained in:
Katie Smith
2017-06-30 10:55:59 +01:00
parent 95f9d26e91
commit 42a8474415
6 changed files with 279 additions and 20 deletions

View File

@@ -0,0 +1,47 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Emails
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">{{ notification_type.capitalize() }}</h1>
<p>
Sending {{ notification_type }} is an invitation&#8209;only feature.
</p>
<p>
If you want to try it out,
<a href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>
{% set
back_link_dict = {
'add_new_template': {
'url' : '.add_template_by_type', 'text': 'Back to add new template'
},
'templates': {
'url' : '.choose_template', 'text' : 'Back to templates'
},
'view_template': {
'url' :'.view_template', 'text' : 'Back to the template'
}
}
%}
{{ page_footer(
back_link=url_for(
back_link_dict[return_to]['url'],
service_id=current_service.id,
template_id=template_id),
back_link_text=back_link_dict[return_to]['text']
) }}
</div>
</div>
{% endblock %}