Skip to content

Commit

Permalink
post-merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaetani committed Apr 17, 2024
1 parent b61fd2b commit 281edb5
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 170 deletions.
317 changes: 157 additions & 160 deletions app/templates/views/service-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,82 +124,7 @@ <h1 class="heading-medium">Settings</h1>
}}
{% endcall %}

{% call mapping_table(
caption='Text message settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}

{% call row() %}
{{ text_field('Send text messages') }}
{{ boolean_field('sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for(
'.service_set_channel',
service_id=current_service.id,
channel='sms'
),
permissions=['manage_service'],
suffix='your settings for sending text messages',
)}}
{% endcall %}

{% call settings_row(if_has_permission='sms') %}
{{ text_field('Text message senders') }}
{% call field(status='default' if current_service.default_sms_sender == "None" else '') %}
{{ current_service.default_sms_sender | nl2br if current_service.default_sms_sender else 'None'}}
{% if current_service.count_sms_senders > 1 %}
<div class="hint">
{{ '…and %d more' | format(current_service.count_sms_senders - 1) }}
</div>
{% endif %}
{% endcall %}
{{ edit_field(
'Manage',
url_for('main.service_sms_senders', service_id=current_service.id),
permissions=['manage_service','manage_api_keys'],
suffix='text message senders',
)
}}
{% endcall %}

{% call settings_row(if_has_permission='sms') %}
{{ text_field('Start text messages with service name') }}
{{ boolean_field(current_service.prefix_sms) }}
{{ edit_field(
'Change',
url_for('main.service_set_sms_prefix', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for starting text messages with service name',
)
}}
{% endcall %}

{#{% call settings_row(if_has_permission='sms') %}
{{ text_field('Send international text messages') }}
{{ boolean_field('international_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('main.service_set_international_sms', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for sending international text messages',
)
}}
{% endcall %}#}

{#{% call settings_row(if_has_permission='sms') %}
{{ text_field('Receive text messages') }}
{{ boolean_field('inbound_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('main.service_receive_text_messages', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for receiving text messages',
)
}}
{% endcall %}#}
{% set email_options_url = url_for('main.email_branding_options', service_id=current_service.id) %}

{% call settings_row(if_has_permission='email') %}
{{ text_field('Email branding') }}
Expand All @@ -212,108 +137,180 @@ <h1 class="heading-medium">Settings</h1>
)}}
{% endcall %}

{#{% call mapping_table(
caption='Letter settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}
{% call settings_row(if_has_permission='email') %}
{{ text_field('Send files by email') }}
{{ optional_text_field(current_service.contact_link, default="Not set up", truncate=true) }}
{{ edit_field(
'Manage',
url_for('main.send_files_by_email_contact_details', service_id=current_service.id),
permissions=['manage_service'],
suffix='sending files by email',
)}}
{% endcall %}

{% call row() %}
{{ text_field('Send letters') }}
{{ boolean_field('letter' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for(
'.service_set_channel',
channel='letter',
service_id=current_service.id
),
permissions=['manage_service'],
suffix='your settings for sending letters',
)}}
{% endcall %}

{% call mapping_table(
caption='Text message settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}

{% call row() %}
{{ text_field('Send text messages') }}
{{ boolean_field('sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for(
'.service_set_channel',
service_id=current_service.id,
channel='sms'
),
permissions=['manage_service'],
suffix='your settings for sending text messages',
)}}
{% endcall %}

{% call settings_row(if_has_permission='sms') %}
{{ text_field('Text message sender IDs') }}
{% call field(status='default' if current_service.default_sms_sender == "None" else '') %}
{{ current_service.default_sms_sender | nl2br if current_service.default_sms_sender else 'None'}}
{% if current_service.count_sms_senders > 1 %}
<div class="hint">
{{ '…and %d more' | format(current_service.count_sms_senders - 1) }}
</div>
{% endif %}
{% endcall %}
{{ edit_field(
'Manage',
url_for('main.service_sms_senders', service_id=current_service.id),
permissions=['manage_service','manage_api_keys'],
suffix='text message sender IDs',
)
}}
{% endcall %}

{% call settings_row(if_has_permission='letter') %}
{{ text_field('Send international letters') }}
{{ boolean_field(current_service.has_permission('international_letters')) }}
{{ edit_field(
{% call settings_row(if_has_permission='sms') %}
{{ text_field('Start text messages with service name') }}
{{ boolean_field(current_service.prefix_sms) }}
{{ edit_field(
'Change',
url_for('main.service_set_international_letters', service_id=current_service.id),
permissions=['manage_service']
)}}
{% endcall %}
url_for('main.service_set_sms_prefix', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for starting text messages with service name',
)
}}
{% endcall %}

{% call settings_row(if_has_permission='letter') %}
{{ text_field('Sender addresses') }}
{% call field(status='' if current_service.count_letter_contact_details else 'default') %}
{% if current_service.default_letter_contact_block %}
{{ current_service.default_letter_contact_block.contact_block | nl2br }}
{% elif current_service.count_letter_contact_details %}
Blank
{% else %}
Not set
{% endif %}
{% if current_service.count_letter_contact_details > 1 %}
<div class="hint">
{{ '…and %d more' | format(current_service.count_letter_contact_details - 1) }}
</div>
{% endif %}
{% endcall %}
{{ edit_field(
'Manage',
url_for('main.service_letter_contact_details', service_id=current_service.id),
permissions=['manage_service','manage_api_keys'],
suffix='sender addresses',
)
}}
{% endcall %}
{% call settings_row(if_has_permission='sms') %}
{{ text_field('Send international text messages') }}
{{ boolean_field('international_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('main.service_set_international_sms', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for sending international text messages',
)
}}
{% endcall %}

{% call settings_row(if_has_permission='letter') %}
{{ text_field('Letter branding') }}
{{ optional_text_field(current_service.letter_branding.name) }}
{{ edit_field(
{% call settings_row(if_has_permission='sms') %}
{{ text_field('Receive text messages') }}
{{ boolean_field('inbound_sms' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for('main.letter_branding_options', service_id=current_service.id),
url_for('main.service_receive_text_messages', service_id=current_service.id),
permissions=['manage_service'],
suffix='letter branding',
)}}
suffix='your settings for receiving text messages',
)
}}
{% endcall %}

{% endcall %}

{% call mapping_table(
caption='Letter settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=True
) %}

{% call row() %}
{{ text_field('Send letters') }}
{{ boolean_field('letter' in current_service.permissions) }}
{{ edit_field(
'Change',
url_for(
'.service_set_channel',
channel='letter',
service_id=current_service.id
),
permissions=['manage_service'],
suffix='your settings for sending letters',
)}}
{% endcall %}

{% call settings_row(if_has_permission='letter') %}
{{ text_field('Send international letters') }}
{{ boolean_field(current_service.has_permission('international_letters')) }}
{{ edit_field(
'Change',
url_for('main.service_set_international_letters', service_id=current_service.id),
permissions=['manage_service'],
suffix='your settings for sending international letters',
)}}
{% endcall %}

{% call settings_row(if_has_permission='letter') %}
{{ text_field('Sender addresses') }}
{% call field(status='' if current_service.count_letter_contact_details else 'default') %}
{% if current_service.default_letter_contact_block %}
{{ current_service.default_letter_contact_block.contact_block | nl2br }}
{% elif current_service.count_letter_contact_details %}
Blank
{% else %}
Not set
{% endif %}
{% if current_service.count_letter_contact_details > 1 %}
<div class="hint">
{{ '…and %d more' | format(current_service.count_letter_contact_details - 1) }}
</div>
{% endif %}
{% endcall %}
{{ edit_field(
'Manage',
url_for('main.service_letter_contact_details', service_id=current_service.id),
permissions=['manage_service','manage_api_keys'],
suffix='sender addresses',
)
}}
{% endcall %}

{% endcall %}#}
{% endif %}
{% call settings_row(if_has_permission='letter') %}
{{ text_field('Letter branding') }}
{{ optional_text_field(current_service.letter_branding.name) }}
{{ edit_field(
'Change',
url_for('main.letter_branding_options', service_id=current_service.id),
permissions=['manage_service'],
suffix='letter branding',
)}}
{% endcall %}

{% endcall %}
</div>

{% if current_service.trial_mode %}
<h2 class="heading-medium top-gutter-0">Your service is in trial mode</h2>

<p class="govuk-body">You can only:</p>

<ul class="govuk-list govuk-list--bullet">
<li>send messages to yourself and other people in your team</li>
<li>send {{ current_service.email_message_limit | message_count('email') }} per day</li>
<li>send {{ current_service.sms_message_limit | message_count('sms') }} per day</li>
<!--<li>create letter templates, but not send them</li>-->
</ul>

<p class="govuk-body">
{% if current_user.has_permissions('manage_service') %}
To remove these restrictions, you can send us a
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.support') }}">request to go live</a>.
{% else %}
Your service manager can ask to have these restrictions removed.
{% endif %}
</p>

{% else %}
<h2 class="heading-medium top-gutter-0">Your service is live</h2>
<p class="govuk-body">
You can send up to:
</p>
<ul class="govuk-list govuk-list--bullet">
<li>{{ current_service.email_message_limit | message_count('email') }} per day</li>
<li>{{ current_service.sms_message_limit | message_count('sms') }} per day</li>
{#<li>{{ current_service.letter_message_limit | message_count('letter') }} per day</li>#}
<li>send messages to yourself and other people in your team</li>
<li>send {{ current_service.email_message_limit | message_count('email') }} per day</li>
<li>send {{ current_service.sms_message_limit | message_count('sms') }} per day</li>
<li>create letter templates, but not send them</li>
</ul>

<p class="govuk-body">
Expand Down
16 changes: 6 additions & 10 deletions app/templates/views/templates/choose.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@
{{ page_header(page_title, size='medium') }}

<p class="govuk-body">
{% if current_service.has_permission('broadcast') %}
You haven’t added any templates yet.
{% else %}
{% if current_user.has_permissions('manage_templates') %}
You need a template before you can
{% else %}
You need to ask your service manager to add templates before you can
{% endif %}
send emails and text messages.
{% endif %}
{% if current_user.has_permissions('manage_templates') %}
You need a template before you can
{% else %}
You need to ask your service manager to add templates before you can
{% endif %}
send emails, text messages or letters.
</p>

{% else %}
Expand Down

0 comments on commit 281edb5

Please sign in to comment.