From a3ba0080f721597bc61391c4135b3763eb548ecb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 15 Jul 2010 07:30:44 -0400 Subject: [PATCH] Fixed #bea/0a2# : Humanize empty result pages. Added a special template for empty bug lists: interfaces/web/templates/empty-list.html --- .../bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values | 2 +- interfaces/web/templates/empty-list.html | 11 +++++++++++ interfaces/web/web.py | 7 +++++-- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 interfaces/web/templates/empty-list.html diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values index 637fc47..2ba3c45 100644 --- a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values @@ -12,7 +12,7 @@ extra_strings: severity: minor -status: open +status: fixed summary: Humanize empty result pages. diff --git a/interfaces/web/templates/empty-list.html b/interfaces/web/templates/empty-list.html new file mode 100644 index 0000000..4c01cb2 --- /dev/null +++ b/interfaces/web/templates/empty-list.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block page_title %} + {{ label }} +{% endblock %} + +{% block content %} +

+ No matching bugs. +

+{% endblock %} diff --git a/interfaces/web/web.py b/interfaces/web/web.py index 75a430d..d910420 100644 --- a/interfaces/web/web.py +++ b/interfaces/web/web.py @@ -94,9 +94,12 @@ class WebInterface: label += ' Currently Unschdeuled' if target == 'None' \ else ' Scheduled for %s' % (target,) - template = self.env.get_template('list.html') bugs = self.filter_bugs(status, assignee, target) - + if len(bugs) == 0: + template = self.env.get_template('empty-list.html') + else: + template = self.env.get_template('list.html') + common_info = self.get_common_information() return template.render(bugs=bugs, bd=self.bd, label=label, assignees=common_info['possible_assignees'], -- 2.26.2