From cfc572d4f7692a8a6177321ee3d49b2c04559c3c Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 21 Jul 2017 10:30:55 +0100 Subject: [PATCH] Add some internal navigation for platform admin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are way too many links in the top nav now (when you’re using the site as a platform admin). And how often are you going to look at the letter jobs page really? This commit adds some internal navigation for the platform admin area of the platform, copying the style that works for navigating a single service. --- app/templates/views/letter-jobs.html | 4 +- .../views/platform-admin/_base_template.html | 34 ++++ app/templates/views/platform-admin/index.html | 28 ++-- .../views/platform-admin/services.html | 4 +- app/templates/views/providers/providers.html | 155 +++++++++--------- 5 files changed, 125 insertions(+), 100 deletions(-) create mode 100644 app/templates/views/platform-admin/_base_template.html diff --git a/app/templates/views/letter-jobs.html b/app/templates/views/letter-jobs.html index 053a813af..d314acfa0 100644 --- a/app/templates/views/letter-jobs.html +++ b/app/templates/views/letter-jobs.html @@ -1,11 +1,11 @@ -{% extends "withoutnav_template.html" %} +{% extends "views/platform-admin/_base_template.html" %} {% from "components/page-footer.html" import page_footer %} {% block per_page_title %} Letter jobs {% endblock %} -{% block maincolumn_content %} +{% block platform_admin_content %}

Letter jobs

diff --git a/app/templates/views/platform-admin/_base_template.html b/app/templates/views/platform-admin/_base_template.html new file mode 100644 index 000000000..d48756cab --- /dev/null +++ b/app/templates/views/platform-admin/_base_template.html @@ -0,0 +1,34 @@ +{% extends "withoutnav_template.html" %} +{% from "components/textbox.html" import textbox %} +{% from "components/checkbox.html" import checkbox %} +{% from "components/page-footer.html" import page_footer %} + +{% block maincolumn_content %} + +
+
+

+ Platform admin +

+ +
+
+ {% block platform_admin_content %}{% endblock %} +
+
+ +{% endblock %} diff --git a/app/templates/views/platform-admin/index.html b/app/templates/views/platform-admin/index.html index 46c7e2c96..e5af04d3e 100644 --- a/app/templates/views/platform-admin/index.html +++ b/app/templates/views/platform-admin/index.html @@ -1,4 +1,4 @@ -{% extends "withoutnav_template.html" %} +{% extends "views/platform-admin/_base_template.html" %} {% from "components/textbox.html" import textbox %} {% from "components/big-number.html" import big_number %} {% from "components/checkbox.html" import checkbox %} @@ -83,22 +83,18 @@ Platform admin {% endblock %} -{% block maincolumn_content %} +{% block platform_admin_content %} -

- Platform admin -

- -
- Apply filters -
- {{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }} - {{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }} - {{ checkbox(form.include_from_test_key) }} -
- -
-
+
+ Apply filters +
+ {{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }} + {{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }} + {{ checkbox(form.include_from_test_key) }} +
+ +
+
{% include "views/platform-admin/_global_stats.html" %} diff --git a/app/templates/views/platform-admin/services.html b/app/templates/views/platform-admin/services.html index f57517543..d866658d1 100644 --- a/app/templates/views/platform-admin/services.html +++ b/app/templates/views/platform-admin/services.html @@ -1,4 +1,4 @@ -{% extends "withoutnav_template.html" %} +{% extends "views/platform-admin/_base_template.html" %} {% from "components/textbox.html" import textbox %} {% from "components/checkbox.html" import checkbox %} {% from "components/page-footer.html" import page_footer %} @@ -84,7 +84,7 @@ {{ page_title|capitalize }} {% endblock %} -{% block maincolumn_content %} +{% block platform_admin_content %}

{{ page_title|capitalize }} diff --git a/app/templates/views/providers/providers.html b/app/templates/views/providers/providers.html index 2da7cde9d..b7320fa87 100644 --- a/app/templates/views/providers/providers.html +++ b/app/templates/views/providers/providers.html @@ -1,4 +1,4 @@ -{% extends "withoutnav_template.html" %} +{% extends "views/platform-admin/_base_template.html" %} {% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading %} {% from "components/show-more.html" import show_more %} @@ -6,112 +6,107 @@ Providers {% endblock %} -{% block maincolumn_content %} +{% block platform_admin_content %} -
-
-

Providers

+

Providers

-

SMS

+

SMS

- {% call(item, row_number) list_table( - domestic_sms_providers, - caption="Domestic SMS providers", - caption_visible=False, - empty_message='No domestic sms providers', - field_headings=['Provider', 'Priority', 'Active', 'Last Updated', 'Updated By'], - field_headings_visible=True - ) %} + {% call(item, row_number) list_table( + domestic_sms_providers, + caption="Domestic SMS providers", + caption_visible=False, + empty_message='No domestic 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)) }} + {{ link_field(item.display_name, url_for('main.view_provider', provider_id=item.id)) }} - {{ text_field(item.priority) }} + {{ text_field(item.priority) }} - {{ text_field(item.active) }} + {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {% 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 %} + {% 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)) }} + {{ link_field('change', url_for('main.edit_provider', provider_id=item.id)) }} - {% endcall %} + {% endcall %} -

Email

+

Email

- {% call(item, row_number) list_table( - email_providers, - caption="Email providers", - caption_visible=False, - empty_message='No email providers', - field_headings=['Provider', 'Priority', 'Active', 'Last Updated', 'Updated By'], - field_headings_visible=True - ) %} + {% call(item, row_number) list_table( + email_providers, + caption="Email providers", + caption_visible=False, + empty_message='No email 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)) }} + {{ link_field(item.display_name, url_for('main.view_provider', provider_id=item.id)) }} - {{ text_field(item.priority) }} + {{ text_field(item.priority) }} - {{ text_field(item.active) }} + {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {% 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 %} + {% 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)) }} + {{ link_field('change', url_for('main.edit_provider', provider_id=item.id)) }} - {% endcall %} + {% endcall %} -

International SMS Providers

+

International SMS Providers

- {% 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 - ) %} + {% 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)) }} + {{ link_field(item.display_name, url_for('main.view_provider', provider_id=item.id)) }} - {{ text_field(item.priority) }} + {{ text_field(item.priority) }} - {{ text_field(item.active) }} + {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {% 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 %} + {% 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)) }} + {{ link_field('change', url_for('main.edit_provider', provider_id=item.id)) }} - {% endcall %} - -
-
+ {% endcall %} {% endblock %}