From 7c8ce6c62ab5c20e0ab1e46d46016605d2c24a64 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 23 Apr 2019 10:31:32 +0100 Subject: [PATCH] Make platform admin settings table body copy size No reason why it should be smaller and harder to read than the user-facing settings table. --- app/templates/views/service-settings.html | 174 +++++++++++----------- 1 file changed, 89 insertions(+), 85 deletions(-) diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index 91cb71aed..ec7cec666 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -278,98 +278,102 @@ {% if current_user.platform_admin %} -

Platform admin settings

- {% call mapping_table( - caption='Settings', - field_headings=['Label', 'Value', 'Action'], - field_headings_visible=False, - caption_visible=False - ) %} +
- {% call row() %} - {{ text_field('Live')}} - {% if current_service.trial_mode and not current_service.organisation %} - {{ text_field('No (you need to assign this service to an organisation before you can make it live)') }} - {{ text_field('') }} - {% else %} - {{ boolean_field(not current_service.trial_mode) }} - {{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id)) }} - {% endif %} - {% endcall %} +

Platform admin settings

- {% call row() %} - {{ text_field('Count in list of live services')}} - {{ text_field('Yes' if current_service.count_as_live else 'No') }} - {{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id)) }} - {% endcall %} + {% call mapping_table( + caption='Settings', + field_headings=['Label', 'Value', 'Action'], + field_headings_visible=False, + caption_visible=False + ) %} - {% call row() %} - {{ text_field('Organisation')}} - {{ optional_text_field(current_service.organisation.name) }} - {{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }} - {% endcall %} - {% call row() %} - {{ text_field('Organisation type')}} - {{ optional_text_field( - (current_service.organisation_type or '')|title - ) }} - {{ edit_field('Change', url_for('.set_organisation_type', service_id=current_service.id)) }} - {% endcall %} - {% call row() %} - {{ text_field('Free text message allowance')}} - {{ text_field('{:,}'.format(current_service.free_sms_fragment_limit)) }} - {{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id)) }} - {% endcall %} - {% call row() %} - {{ text_field('Email branding' )}} - {{ text_field(current_service.email_branding_name) }} - {{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id)) }} - {% endcall %} - {% call row() %} - {{ text_field('Letter branding')}} - {{ optional_text_field(current_service.letter_branding.name) }} - {{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id)) }} - {% endcall %} - {% call row() %} - {{ text_field('Data retention')}} - {% call field() %} - {{ current_service.data_retention | join(', ', attribute='notification_type') }} + {% call row() %} + {{ text_field('Live')}} + {% if current_service.trial_mode and not current_service.organisation %} + {{ text_field('No (you need to assign this service to an organisation before you can make it live)') }} + {{ text_field('') }} + {% else %} + {{ boolean_field(not current_service.trial_mode) }} + {{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id)) }} + {% endif %} {% endcall %} - {{ edit_field('Change', url_for('.data_retention', service_id=current_service.id)) }} + + {% call row() %} + {{ text_field('Count in list of live services')}} + {{ text_field('Yes' if current_service.count_as_live else 'No') }} + {{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id)) }} + {% endcall %} + + {% call row() %} + {{ text_field('Organisation')}} + {{ optional_text_field(current_service.organisation.name) }} + {{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }} + {% endcall %} + {% call row() %} + {{ text_field('Organisation type')}} + {{ optional_text_field( + (current_service.organisation_type or '')|title + ) }} + {{ edit_field('Change', url_for('.set_organisation_type', service_id=current_service.id)) }} + {% endcall %} + {% call row() %} + {{ text_field('Free text message allowance')}} + {{ text_field('{:,}'.format(current_service.free_sms_fragment_limit)) }} + {{ edit_field('Change', url_for('.set_free_sms_allowance', service_id=current_service.id)) }} + {% endcall %} + {% call row() %} + {{ text_field('Email branding' )}} + {{ text_field(current_service.email_branding_name) }} + {{ edit_field('Change', url_for('.service_set_email_branding', service_id=current_service.id)) }} + {% endcall %} + {% call row() %} + {{ text_field('Letter branding')}} + {{ optional_text_field(current_service.letter_branding.name) }} + {{ edit_field('Change', url_for('.service_set_letter_branding', service_id=current_service.id)) }} + {% endcall %} + {% call row() %} + {{ text_field('Data retention')}} + {% call field() %} + {{ current_service.data_retention | join(', ', attribute='notification_type') }} + {% endcall %} + {{ edit_field('Change', url_for('.data_retention', service_id=current_service.id)) }} + {% endcall %} + + {% for permission in service_permissions %} + {% if not service_permissions[permission].requires or current_service.has_permission(service_permissions[permission].requires) %} + {% call row() %} + {{ text_field(service_permissions[permission].title)}} + {{ boolean_field(current_service.has_permission(permission)) }} + {{ edit_field('Change', url_for(service_permissions[permission].endpoint or '.service_set_permission', service_id=current_service.id, permission=permission if not service_permissions[permission].endpoint else None)) }} + {% endcall %} + {% endif %} + {% endfor %} + {% endcall %} - {% for permission in service_permissions %} - {% if not service_permissions[permission].requires or current_service.has_permission(service_permissions[permission].requires) %} - {% call row() %} - {{ text_field(service_permissions[permission].title)}} - {{ boolean_field(current_service.has_permission(permission)) }} - {{ edit_field('Change', url_for(service_permissions[permission].endpoint or '.service_set_permission', service_id=current_service.id, permission=permission if not service_permissions[permission].endpoint else None)) }} - {% endcall %} + +
{% endif %}