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.
This commit is contained in:
Chris Hill-Scott
2019-04-23 10:31:32 +01:00
parent 5ac2abb7bc
commit 7c8ce6c62a

View File

@@ -278,98 +278,102 @@
{% if current_user.platform_admin %} {% if current_user.platform_admin %}
<h2 class="heading-medium">Platform admin settings</h2> <div class="settings-table body-copy-table top-gutter-4-3">
{% call mapping_table(
caption='Settings',
field_headings=['Label', 'Value', 'Action'],
field_headings_visible=False,
caption_visible=False
) %}
{% call row() %} <h2 class="heading-medium">Platform admin settings</h2>
{{ 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 %}
{% call row() %} {% call mapping_table(
{{ text_field('Count in list of live services')}} caption='Settings',
{{ text_field('Yes' if current_service.count_as_live else 'No') }} field_headings=['Label', 'Value', 'Action'],
{{ edit_field('Change', url_for('.service_switch_count_as_live', service_id=current_service.id)) }} field_headings_visible=False,
{% endcall %} caption_visible=False
) %}
{% call row() %} {% call row() %}
{{ text_field('Organisation')}} {{ text_field('Live')}}
{{ optional_text_field(current_service.organisation.name) }} {% if current_service.trial_mode and not current_service.organisation %}
{{ edit_field('Change', url_for('.link_service_to_organisation', service_id=current_service.id)) }} {{ text_field('No (you need to assign this service to an organisation before you can make it live)') }}
{% endcall %} {{ text_field('') }}
{% call row() %} {% else %}
{{ text_field('Organisation type')}} {{ boolean_field(not current_service.trial_mode) }}
{{ optional_text_field( {{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id)) }}
(current_service.organisation_type or '')|title {% endif %}
) }}
{{ 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 %} {% 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 %} {% endcall %}
{% for permission in service_permissions %} <ul>
{% if not service_permissions[permission].requires or current_service.has_permission(service_permissions[permission].requires) %} {% if current_service.active %}
{% call row() %} <li class="bottom-gutter">
{{ text_field(service_permissions[permission].title)}} <a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
{{ boolean_field(current_service.has_permission(permission)) }} Archive service
{{ 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)) }} </a>
{% endcall %} </li>
<li class="bottom-gutter">
<a href="{{ url_for('.suspend_service', service_id=current_service.id) }}" class="button">
Suspend service
</a>
</li>
{% else %}
<li class="bottom-gutter">
<a href="{{ url_for('.resume_service', service_id=current_service.id) }}" class="button">
Resume service
</a>
</li>
{% endif %} {% endif %}
{% endfor %} </ul>
</div>
{% endcall %}
<ul>
{% if current_service.active %}
<li class="bottom-gutter">
<a href="{{ url_for('.archive_service', service_id=current_service.id) }}" class="button">
Archive service
</a>
</li>
<li class="bottom-gutter">
<a href="{{ url_for('.suspend_service', service_id=current_service.id) }}" class="button">
Suspend service
</a>
</li>
{% else %}
<li class="bottom-gutter">
<a href="{{ url_for('.resume_service', service_id=current_service.id) }}" class="button">
Resume service
</a>
</li>
{% endif %}
</ul>
{% endif %} {% endif %}