"""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':
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 != '':
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)
$('#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');
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">+ 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>
<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 %}