From 65761e5c1792b3fe73cff1fcb9a0d211eb81cf63 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 7 Apr 2016 15:30:52 +0100 Subject: [PATCH 1/2] Change banners on home page if no permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (except view activity, natch) > No permissions – Remove trial mode banner > No permissions – Add blue banner saying 'You only have permission to view this service' --- app/templates/views/dashboard/dashboard.html | 10 +++++++--- .../views/dashboard/no-permissions-banner.html | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 app/templates/views/dashboard/no-permissions-banner.html diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index adabb0594..aab538aeb 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -8,10 +8,14 @@ {% if not templates and current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], any_=True) %} {% include 'views/dashboard/get-started.html' %} - {% elif current_service.restricted %} -
+ {% elif current_user.has_permissions([ + 'manage_templates', 'manage_api_keys', 'manage_users', 'manage_settings + '], any_=True, admin_override=True) %} + {% if current_service.restricted %} {% include 'views/dashboard/trial-mode-banner.html' %} -
+ {% endif %} + {% else %} + {% include 'views/dashboard/no-permissions-banner.html' %} {% endif %}
Date: Thu, 7 Apr 2016 15:34:46 +0100 Subject: [PATCH 2/2] Shorten empty message on choose template You may have permission to add templates but not to send messages. The previous error message was misleading. --- app/templates/views/choose-template.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/templates/views/choose-template.html b/app/templates/views/choose-template.html index 15d1ba883..655dbe03c 100644 --- a/app/templates/views/choose-template.html +++ b/app/templates/views/choose-template.html @@ -16,8 +16,9 @@ {% if current_user.has_permissions(permissions=['manage_templates'], any_=True) %}

- You need a template before you can send - {{ 'emails' if 'email' == template_type else 'text messages' }} + There are no + {{ 'email' if 'email' == template_type else 'text message' }} + templates

Add a new template {% else %}