From 7e670d9662b633e13f220156aa9323dd42708f98 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 4 Feb 2016 17:13:57 +0000 Subject: [PATCH 1/2] Limit number of jobs on dashboard to 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and add a link to view the rest of the jobs if there are more than 5. --- app/assets/stylesheets/components/table.scss | 7 +++++++ app/main/views/dashboard.py | 3 ++- app/templates/views/service_dashboard.html | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/components/table.scss b/app/assets/stylesheets/components/table.scss index 97b14296c..f92472c12 100644 --- a/app/assets/stylesheets/components/table.scss +++ b/app/assets/stylesheets/components/table.scss @@ -60,3 +60,10 @@ border-bottom: 1px solid $border-colour; padding: 0.75em 0 0.5625em 0; } + +.table-show-more-link { + margin-top: -20px; + border-bottom: 1px solid $border-colour; + padding-bottom: 10px; + @include bold-16; +} diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index 86acf81c1..42505b9c4 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -28,7 +28,8 @@ def service_dashboard(service_id): raise e return render_template( 'views/service_dashboard.html', - jobs=list(reversed(jobs)), + jobs=list(reversed(jobs))[:5], + more_jobs_to_show=(len(jobs) > 5), free_text_messages_remaining='250,000', spent_this_month='0.00', template_count=len(templates), diff --git a/app/templates/views/service_dashboard.html b/app/templates/views/service_dashboard.html index f2dca758d..8dbec1142 100644 --- a/app/templates/views/service_dashboard.html +++ b/app/templates/views/service_dashboard.html @@ -58,6 +58,11 @@ {{ item.status }} {% endcall %} {% endcall %} + {% if more_jobs_to_show %} + + {% endif %} {% endif %} {% endblock %} From eba03d0bb594aa5e22fe4c5078f899ccae2c2018 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 4 Feb 2016 17:26:53 +0000 Subject: [PATCH 2/2] Remove job ID from jobs table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t think it’s something we need to surface to users. --- app/templates/views/jobs.html | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/templates/views/jobs.html b/app/templates/views/jobs.html index db8c6c7d5..ae52bd253 100644 --- a/app/templates/views/jobs.html +++ b/app/templates/views/jobs.html @@ -1,5 +1,5 @@ {% extends "withnav_template.html" %} -{% from "components/table.html" import list_table, field %} +{% from "components/table.html" import list_table, field, right_aligned_field_heading %} {% block page_title %} GOV.UK Notify | Notifications activity @@ -14,18 +14,15 @@ GOV.UK Notify | Notifications activity caption="Recent activity", caption_visible=False, empty_message='You haven’t sent any notifications yet', - field_headings=['Job', 'File', 'Time', 'Status'] + field_headings=['Job', 'Time', right_aligned_field_heading('Status')] ) %} - {% call field() %} - {{ item.id }} - {% endcall %} {% call field() %} {{ item.original_file_name }} {% endcall %} {% call field() %} {{ item.created_at | format_datetime}} {% endcall %} - {% call field() %} + {% call field(align='right') %} {{ item.status }} {% endcall %} {% endcall %}