From 7e670d9662b633e13f220156aa9323dd42708f98 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 4 Feb 2016 17:13:57 +0000 Subject: [PATCH] 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 %}