2
groups - a dict, where:
3
key - is the value shared by all results in this group
4
value - is the list of corresponding tickets
6
headers - a sequence of header structure:
7
.name - field name for this header
8
.label - what to display for this header
10
fields - dict of field name to field structure:
13
query - the actual Query instance used to perform the query
16
<div xmlns="http://www.w3.org/1999/xhtml"
17
xmlns:py="http://genshi.edgewall.org/"
18
xmlns:xi="http://www.w3.org/2001/XInclude">
19
<xi:include href="macros.html" />
21
<py:def function="num_matches(v)">
22
<span class="numrows">(${v or 'No'} match${v != 1 and 'es' or ''})</span>
25
<h2 py:if="paginator.has_more_pages">
26
Results <span class="numresults">(${paginator.displayed_items()})</span>
28
<xi:include py:if="paginator.show_index" href="page_index.html" />
29
<py:for each="group_index, (groupname, results) in enumerate(groups)">
30
<h2 py:if="groupname">
31
${fields[query.group].label}:
32
${query.group in ['owner', 'reporter'] and authorinfo(groupname) or groupname}
33
${num_matches(len(results))}
35
<table class="listing tickets">
38
<th py:for="header in headers"
39
class="$header.name${query.order == header.name and (query.desc and ' desc' or ' asc') or ''}">
40
<a title="Sort by $header.label${query.order == header.name and not query.desc and ' (descending)' or ''}"
41
href="$header.href">${header.label}</a>
47
<py:for each="idx, result in enumerate(results)">
48
<py:with vars="ticket_context = context('ticket', result.id)">
49
<py:if test="'TICKET_VIEW' in perm(ticket_context.resource)">
51
<tr class="${idx % 2 and 'odd' or 'even'} prio${result.priority_value}${
52
'added' in result and ' added' or ''}${
53
'changed' in result and ' changed' or ''}${
54
'removed' in result and ' removed' or ''}">
55
<py:for each="idx, header in enumerate(headers)" py:choose="">
56
<py:with vars="name = header.name; value = result[name]">
57
<td py:when="name == 'id'" class="id"><a href="$result.href" title="View ticket" class="${classes(closed=result.status == 'closed')}">#$result.id</a></td>
58
<td py:otherwise="" class="$name" py:choose="">
59
<a py:when="name == 'summary'" href="$result.href" title="View ticket">$value</a>
60
<py:when test="isinstance(value, datetime)">${dateinfo(value)}</py:when>
61
<py:when test="name == 'reporter'">${authorinfo(value)}</py:when>
62
<py:when test="name == 'cc'">${format_emails(ticket_context, value)}</py:when>
63
<py:when test="name == 'owner' and value">${authorinfo(value)}</py:when>
64
<py:otherwise>$value</py:otherwise>
70
<py:with vars="result_rows = [t for t in row if result[t]]">
71
<tr py:if="result_rows" class="fullrow">
72
<td colspan="${len(headers)}">
73
<p class="meta">Reported by <strong>${authorinfo(result.reporter)}</strong>,
74
${dateinfo(result.time)} ago.</p>
78
<tr py:when="ticket_context.resource in context" class="fullrow">
79
<td colspan="${len(headers)}">
80
<p class="meta"><em>(this ticket)</em></p>
83
<tr py:otherwise="" py:for="r in result_rows" class="fullrow">
84
<th class="meta">$r</th>
85
<td colspan="${len(headers)-1}" xml:space="preserve">
86
${wiki_to_html(ticket_context, result[r])}
94
<tr py:if="group_index == len(groups)-1 and last_group_is_partial">
95
<td colspan="${len(headers)}">
96
<i>(more results for this group on next page)</i>
102
<xi:include py:if="paginator.show_index" href="page_index.html" />