Implemented the status filter.
authorSteve Losh <steve@stevelosh.com>
Sat, 31 Jan 2009 04:53:09 +0000 (23:53 -0500)
committerSteve Losh <steve@stevelosh.com>
Sat, 31 Jan 2009 04:53:09 +0000 (23:53 -0500)
.be/bugs/984472f6-98f5-48fc-b521-70a1e5f60614/values
.be/bugs/decc6e78-a3db-4cd3-ad23-2bf8ed77cb0d/values
cfbe.py
static/style/cfbe.css
templates/base.html
templates/list.html

index 3abc05052d8c01c7b5a02886bf43e85dd445504c..21d3cefd85a6e252ca17d5b31db8382a2c64eada 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement the status filters.
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 00:22:40 +0000
 
 
index 7b5aaaddf975cedf3d13b9266a028eb85ac26bbf..96f52d3719c262c5dc968566dbec3cfeb7b23f83 100644 (file)
@@ -22,7 +22,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
@@ -36,6 +36,13 @@ summary=Implement the target filters.
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 02:58:44 +0000
 
 
diff --git a/cfbe.py b/cfbe.py
index 7e2db0ed71c181be7830a02a7b938af6d4a300b5..4509bf18e4bfa4279b3f6e830250f01c931bff75 100755 (executable)
--- a/cfbe.py
+++ b/cfbe.py
@@ -16,7 +16,7 @@ class WebInterface:
     """The web interface to CFBE."""
     
     @cherrypy.expose
-    def index(self, status='open', assignee=''):
+    def index(self, status='open', assignee='', target=''):
         bd.load_all_bugs()
         
         if status == 'open':
@@ -25,18 +25,28 @@ class WebInterface:
         elif status == 'closed':
             status = ['closed', 'disabled', 'fixed', 'wontfix']
             label = 'All Closed Bugs'
+            
         if assignee != '':
             if assignee == 'None':
                 label += ' Currently Unassigned'
             else:
                 label += ' Assigned to %s' % (assignee,)
         
+        if target != '':
+            if target == 'None':
+                label += ' Currently Unschdeuled'
+            else:
+                label += ' Scheduled for %s' % (target,)
+        
         
         template = env.get_template('list.html')
         
         possible_assignees = list(set([bug.assigned for bug in bd if bug.assigned != None]))
         possible_assignees.sort(key=unicode.lower)
         
+        possible_targets = list(set([bug.target for bug in bd if bug.target != None]))
+        possible_targets.sort(key=unicode.lower)
+        
         bugs = [bug for bug in bd if bug.status in status]
         
         if assignee != '':
@@ -44,8 +54,14 @@ class WebInterface:
                 assignee = None
             bugs = [bug for bug in bugs if bug.assigned == assignee]
         
+        if target != '':
+            if target == 'None':
+                target = None
+            bugs = [bug for bug in bugs if bug.target == target]
+        
         return template.render(bugs=bugs, bd=bd, label=label, 
                                assignees=possible_assignees,
+                               targets=possible_targets,
                                repository_name=repository_name)
     
 
index 3cd4241ad91fdebf5ce0ec4a44f2cb8d0987c8e0..ee699b41c60f0626b214207c4bebdf5af0a180e5 100644 (file)
@@ -30,4 +30,4 @@ table tr td, table tr th { padding: 0px 5px; line-height: 2.916em; }
 table { margin-bottom: 1.417em; }
 tr.stripe { background-color: #f5e5f0; }
 
-div#assignees { display: none; }
+div#assignees, div#targets { display: none; }
index 8f8fb3d6a9741bf122ad1021c1770c56f81e4a0b..66ecd2fa317d634f285dbd4a9d1a5359d7a19aa8 100644 (file)
                 $('#external-pane').hide();
                 $('#external-pane-content').corners('bottom 8px');
                 
-                $('#filter-assignee').click(function() {
+                $('#filter-assignee').click(function(e) {
                     $('#external-pane-content').html($('#assignees').html());
                     $('#external-pane').fadeIn('fast');
+                    e.preventDefault();
+                });
+                
+                $('#filter-target').click(function(e) {
+                    $('#external-pane-content').html($('#targets').html());
+                    $('#external-pane').fadeIn('fast');
+                    e.preventDefault();
                 });
                 
                 $('table tr:odd').addClass('stripe');
@@ -43,8 +50,8 @@
                         Just show me:
                         <a href="/">Open</a>
                         <a href="/?status=closed">Closed</a>
-                        <a href="#" id="filter-assignee">Assigned to...</a>
-                        <a href="#">Scheduled for...</a>
+                        <a href="" id="filter-assignee">Assigned to...</a>
+                        <a href="" id="filter-target">Scheduled for...</a>
                     </span>
                     <span id="create">
                         <a href="fixme">&#43; Create a new bug</a>
                 {% endfor %}
             </p>
         </div>
+        <div id="targets">
+            <p>
+                <a href="/?target=None">Unscheduled</a><br /><br />
+                {% for target in targets %}
+                    <a href="/?target={{ target }}">{{ target }}</a><br />
+                {% endfor %}
+            </p>
+        </div>
     </body>
 </html>
index 34e28d3e186d5965d1b35826a826965a65e1fc31..3dd4a70418e52884283c55056f4b68bda6e8c145 100644 (file)
             <th>ID</th>
             <th>Summary</th>
             <th>Status</th>
+            <th>Target</th>
             <th>Assigned To</th>
         </tr>
         {% for bug in bugs %}
         <tr>
             <td>{{ bd.bug_shortname(bug) }}</td>
-            <td>{{ bug.summary|e|truncate(60) }}</td>
+            <td>{{ bug.summary|e|truncate(65) }}</td>
             <td>{{ bug.status }}</td>
+            <td>{{ bug.target }}</td>
             <td>{{ bug.assigned|striptags }}</td>
         </tr>
         {% endfor %}