~ubuntu-branches/ubuntu/precise/trac/precise

« back to all changes in this revision

Viewing changes to trac/ticket/templates/query_results.html

  • Committer: Bazaar Package Importer
  • Author(s): Luis Matos
  • Date: 2008-07-13 23:46:20 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080713234620-13ynpdpkbaymfg1z
Tags: 0.11-2
* Re-added python-setup-tools to build dependences. Closes: #490320 #468705
* New upstream release Closes: 489727
* Added sugestion for other vcs support available: git bazaar mercurial 
* Added spamfilter plugin to sugests
* Moved packaging from python-support to python-central
* Added an entry to the NEWS about the cgi Closes: #490275
* Updated 10_remove_trac_suffix_from_title patch to be used in 0.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--!
 
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
 
5
 
 
6
       headers   - a sequence of header structure:
 
7
                     .name     - field name for this header
 
8
                     .label    - what to display for this header
 
9
 
 
10
       fields    - dict of field name to field structure:
 
11
                     .label    - field label
 
12
 
 
13
       query     - the actual Query instance used to perform the query
 
14
 
 
15
-->
 
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" />
 
20
  
 
21
  <py:def function="num_matches(v)">
 
22
    <span class="numrows">(${v or 'No'} match${v != 1 and 'es' or ''})</span>
 
23
  </py:def>
 
24
  
 
25
  <h2 py:if="paginator.has_more_pages">
 
26
    Results <span class="numresults">(${paginator.displayed_items()})</span>
 
27
  </h2>
 
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))}
 
34
    </h2>
 
35
    <table class="listing tickets">
 
36
      <thead>
 
37
        <tr>
 
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>
 
42
          </th>
 
43
        </tr>
 
44
      </thead>
 
45
 
 
46
      <tbody>
 
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)">
 
50
 
 
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>
 
65
                    </td>
 
66
                  </py:with>
 
67
                </py:for>
 
68
              </tr>
 
69
 
 
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>
 
75
                  </td>
 
76
                </tr>
 
77
                <py:choose>
 
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>
 
81
                    </td>
 
82
                  </tr>
 
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])}
 
87
                    </td>
 
88
                  </tr>
 
89
                </py:choose>
 
90
              </py:with>
 
91
            </py:if>
 
92
          </py:with>
 
93
        </py:for>
 
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>
 
97
          </td>
 
98
        </tr>
 
99
      </tbody>
 
100
    </table>
 
101
  </py:for>
 
102
  <xi:include py:if="paginator.show_index" href="page_index.html" />
 
103
</div>
 
104
 
 
105