mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 05:30:21 -04:00
Refactored code for new service permissions
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
<nav>
|
||||
<a class="pill-separate-item" href="{{ url_for('.choose_template', service_id=current_service.id) }}">
|
||||
{% if current_service.can_send_letters %}
|
||||
{% if 'letter' in current_service.permissions %}
|
||||
Write an email, text message or letter
|
||||
{% else %}
|
||||
Write an email or text message
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('International text messages') }}
|
||||
{{ boolean_field(current_service.can_send_international_sms) }}
|
||||
{{ boolean_field('international_sms' in current_service.permissions) }}
|
||||
{{ edit_field('Change', url_for('.service_set_international_sms', service_id=current_service.id)) }}
|
||||
{% endcall %}
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
|
||||
{% call row() %}
|
||||
{{ text_field('Letters') }}
|
||||
{{ boolean_field(current_service.can_send_letters) }}
|
||||
{{ boolean_field('letter' in current_service.permissions) }}
|
||||
{{ edit_field('Change', url_for('.service_set_letters', service_id=current_service.id)) }}
|
||||
{% endcall %}
|
||||
|
||||
{% if current_service.can_send_letters %}
|
||||
{% if 'letter' in current_service.permissions %}
|
||||
{% call row() %}
|
||||
{{ text_field('Letter contact details') }}
|
||||
{% call field(status='' if current_service.letter_contact_block else 'default') %}
|
||||
@@ -158,12 +158,12 @@
|
||||
</li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_can_send_letters', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Stop sending letters' if current_service.can_send_letters else 'Allow to send letters' }}
|
||||
{{ 'Stop sending letters' if 'letter' in current_service.permissions else 'Allow to send letters' }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="bottom-gutter">
|
||||
<a href="{{ url_for('.service_switch_can_send_international_sms', service_id=current_service.id) }}" class="button">
|
||||
{{ 'Stop sending international sms' if current_service.can_send_international_sms else 'Allow to send international sms' }}
|
||||
{{ 'Stop sending international sms' if 'international_sms' in current_service.permissions else 'Allow international sms' }}
|
||||
</a>
|
||||
</li>
|
||||
{% if current_service.active %}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
<h1 class="heading-large">International text messages</h1>
|
||||
{% if current_service.can_send_international_sms %}
|
||||
{% if 'international_sms' in current_service.permissions %}
|
||||
<p>
|
||||
Your service can send text messages to international phone numbers.
|
||||
</p>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
<h1 class="heading-large">Letters</h1>
|
||||
{% if current_service.can_send_letters %}
|
||||
{% if 'letter' in current_service.permissions %}
|
||||
<p>
|
||||
Your service can send letters.
|
||||
</p>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{% if current_user.has_permissions(permissions=['manage_templates'], any_=True) %}
|
||||
<p class="bottom-gutter">
|
||||
You need a template before you can send
|
||||
{% if current_service.can_send_letters %}
|
||||
{% if 'letter' in current_service.permissions %}
|
||||
emails, text messages or letters
|
||||
{%- else -%}
|
||||
emails or text messages
|
||||
@@ -27,7 +27,7 @@
|
||||
{% else %}
|
||||
<p>
|
||||
You need to ask your service manager to add templates before you can send
|
||||
{% if current_service.can_send_letters %}
|
||||
{% if 'letter' in current_service.permissions %}
|
||||
emails, text messages or letters
|
||||
{%- else -%}
|
||||
emails or text messages
|
||||
|
||||
Reference in New Issue
Block a user