mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Merge pull request #1241 from alphagov/feat-show-intl-providers-on-page
Show intl providers separately on providers page
This commit is contained in:
@@ -16,12 +16,20 @@ from app import provider_client
|
||||
@user_has_permissions(admin_override=True)
|
||||
def view_providers():
|
||||
providers = provider_client.get_all_providers()['provider_details']
|
||||
email_providers = [email for email in providers if email['notification_type'] == 'email']
|
||||
sms_providers = [sms for sms in providers if sms['notification_type'] == 'sms']
|
||||
domestic_email_providers, domestic_sms_providers, intl_sms_providers = [], [], []
|
||||
for provider in providers:
|
||||
if provider['notification_type'] == 'sms':
|
||||
domestic_sms_providers.append(provider)
|
||||
if provider.get('supports_international', None):
|
||||
intl_sms_providers.append(provider)
|
||||
elif provider['notification_type'] == 'email':
|
||||
domestic_email_providers.append(provider)
|
||||
|
||||
return render_template(
|
||||
'views/providers/providers.html',
|
||||
email_providers=email_providers,
|
||||
sms_providers=sms_providers
|
||||
email_providers=domestic_email_providers,
|
||||
domestic_sms_providers=domestic_sms_providers,
|
||||
intl_sms_providers=intl_sms_providers
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ Providers
|
||||
<h2 class="heading-medium">SMS</h2>
|
||||
|
||||
{% call(item, row_number) list_table(
|
||||
sms_providers,
|
||||
caption="SMS providers",
|
||||
domestic_sms_providers,
|
||||
caption="Domestic SMS providers",
|
||||
caption_visible=False,
|
||||
empty_message='No email providers',
|
||||
empty_message='No domestic sms providers',
|
||||
field_headings=['Provider', 'Priority', 'Active', 'Last Updated', 'Updated By'],
|
||||
field_headings_visible=True
|
||||
) %}
|
||||
@@ -78,6 +78,39 @@ Providers
|
||||
|
||||
{% endcall %}
|
||||
|
||||
<h1 class="heading-large">International SMS Providers</h1>
|
||||
|
||||
{% call(item, row_number) list_table(
|
||||
intl_sms_providers,
|
||||
caption="International SMS providers",
|
||||
caption_visible=False,
|
||||
empty_message='No international sms providers',
|
||||
field_headings=['Provider', 'Priority', 'Active', 'Last Updated', 'Updated By'],
|
||||
field_headings_visible=True
|
||||
) %}
|
||||
|
||||
{{ link_field(item.display_name, url_for('main.view_provider', provider_id=item.id)) }}
|
||||
|
||||
{{ text_field(item.priority) }}
|
||||
|
||||
{{ text_field(item.active) }}
|
||||
|
||||
{% if item.updated_at %}
|
||||
{{ text_field(item.updated_at|format_datetime_short) }}
|
||||
{% else %}
|
||||
{{ text_field('None') }}
|
||||
{% endif %}
|
||||
|
||||
{% if item.created_by %}
|
||||
{{ text_field(item.created_by.name) }}
|
||||
{% else %}
|
||||
{{ text_field('None') }}
|
||||
{% endif %}
|
||||
|
||||
{{ link_field('change', url_for('main.edit_provider', provider_id=item.id)) }}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user