Limit number of jobs on dashboard to 5

…and add a link to view the rest of the jobs if there are more than 5.
This commit is contained in:
Chris Hill-Scott
2016-02-04 17:13:57 +00:00
parent cf08f4ef2a
commit 7e670d9662
3 changed files with 14 additions and 1 deletions

View File

@@ -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),