mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Merge pull request #421 from alphagov/banners-no-permissions
Change banners on home page if no permissions
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
|
||||
{% if current_user.has_permissions(permissions=['manage_templates'], any_=True) %}
|
||||
<p class="bottom-gutter">
|
||||
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
|
||||
</p>
|
||||
<a href="{{ url_for('.add_service_template', service_id=current_service.id, template_type=template_type) }}" class="button">Add a new template</a>
|
||||
{% else %}
|
||||
|
||||
@@ -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 %}
|
||||
<div class="dashboard">
|
||||
{% 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' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include 'views/dashboard/no-permissions-banner.html' %}
|
||||
{% endif %}
|
||||
|
||||
<div
|
||||
|
||||
5
app/templates/views/dashboard/no-permissions-banner.html
Normal file
5
app/templates/views/dashboard/no-permissions-banner.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% from "components/banner.html" import banner_wrapper %}
|
||||
|
||||
{% call banner_wrapper(type="mode") %}
|
||||
You only have permission to view this service
|
||||
{% endcall %}
|
||||
Reference in New Issue
Block a user