Add line to template page if you can’t do anything

If someone has no permissions but needs permissions the thing they’re
probably going to need is to send a message or edit a template.

The place they will probably come to is the place where the buttons
would be – users with these permissions are finding the thing they need
to do on this page.

So this commit adds a line to this page which (hopefully) makes it clear
they’re in the right place, but need to go and speak to someone.
This commit is contained in:
Chris Hill-Scott
2018-03-12 15:46:54 +00:00
parent 4b929aaa6c
commit 9838c3908b
3 changed files with 32 additions and 5 deletions

View File

@@ -44,6 +44,11 @@
margin-top: $gutter-half;
}
.top-gutter-1-3 {
@extend %top-gutter;
margin-top: $gutter / 3;
}
%bottom-gutter,
.bottom-gutter {
@extend %contain-floats;

View File

@@ -1,8 +1,16 @@
{% from 'components/message-count-label.html' import message_count_label %}
<div class="column-whole">
{% if template._template.archived %}
<p class="hint">
This template was deleted {{ template._template.updated_at|format_datetime_relative }}.
</p>
{% elif not current_user.has_permissions('send_messages', 'manage_api_keys', 'manage_templates', 'manage_service') %}
<p class="top-gutter-1-3 {% if template.template_type != 'sms' %}bottom-gutter{% endif %}">
If you need to send this
{{ message_count_label(1, template.template_type, suffix='') }}
or edit this template, contact your manager.
</p>
{% else %}
<div class="bottom-gutter-2-3">
<div class="grid-row">