Fixed #bea/0a2# : Humanize empty result pages.
authorW. Trevor King <wking@drexel.edu>
Thu, 15 Jul 2010 11:30:44 +0000 (07:30 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 15 Jul 2010 11:30:44 +0000 (07:30 -0400)
Added a special template for empty bug lists:
  interfaces/web/templates/empty-list.html

.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values
interfaces/web/templates/empty-list.html [new file with mode: 0644]
interfaces/web/web.py

index 637fc4776bd52606b4719ad36afb35d2361c7a50..2ba3c450318f9a1b899af3efba4a332031eb5562 100644 (file)
@@ -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 (file)
index 0000000..4c01cb2
--- /dev/null
@@ -0,0 +1,11 @@
+{% extends "base.html" %}
+
+{% block page_title %}
+    {{ label }}
+{% endblock %}
+
+{% block content %}
+    <p>
+    No matching bugs.
+    </p>
+{% endblock %}
index 75a430d82e1074788b07a744abb0485f7fb50479..d9104205f9865e348c689e0b642270360f705284 100644 (file)
@@ -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'],