]> git.ozlabs.org Git - patchwork/blob - templates/patchwork/patch-list.html
Zebra-stripe the patch list
[patchwork] / templates / patchwork / patch-list.html
1 {% load person %}
2 {% load listurl %}
3
4 {% include "patchwork/pagination.html" %}
5
6
7 <table class="patchlist">
8  <tr>
9   <td class="patchlistfilters">
10  {% include "patchwork/filters.html" %}
11   </td>
12  </tr>
13 </table>
14
15 {% if page.paginator.long_page and user.is_authenticated %}
16 <div class="floaty">
17  <a title="jump to form" href="#patchforms"><span
18   style="font-size: 120%">&#9662;</span></a>
19 </div>
20 {% endif %}
21
22 <form method="post">
23 <input type="hidden" name="form" value="patchlistform"/>
24 <input type="hidden" name="project" value="{{project.id}}"/>
25 <table class="patchlist">
26  <tr>
27   {% if patchform or bundle %}
28   <th/>
29   {% endif %}
30
31   <th>
32    {% ifequal order.name "name" %}
33     <a class="colactive"
34      href="{% listurl order=order.reversed_name %}">Patch</a>
35    {% else %}
36     <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
37    {% endifequal %}
38   </th>
39
40   <th>
41    {% ifequal order.name "date" %}
42     <a class="colactive"
43      href="{% listurl order=order.reversed_name %}">Date</a>
44    {% else %}
45     <a class="colinactive" href="{% listurl order="date" %}">Date</a>
46    {% endifequal %}
47   </th>
48
49   <th>
50    {% ifequal order.name "submitter" %}
51     <a class="colactive"
52      href="{% listurl order=order.reversed_name %}">Submiter</a>
53    {% else %}
54     <a class="colinactive" href="{% listurl order="submitter" %}">Submitter</a>
55    {% endifequal %}
56   </th>
57
58   <th>
59    {% ifequal order.name "state" %}
60     <a class="colactive"
61      href="{% listurl order=order.reversed_name %}">State</a>
62    {% else %}
63     <a class="colinactive" href="{% listurl order="state" %}">State</a>
64    {% endifequal %}
65   </th>
66
67  </tr>
68
69 {% if page %}
70  {% for patch in page.object_list %}
71   <tr class="{% cycle 'odd' 'even' %}">
72     {% if patchform or bundle %}
73     <td>
74     <input type="checkbox" name="patch_id:{{patch.id}}"/>
75     </td>
76     {% endif %}
77    <td><a href="{% url patchwork.views.patch.patch patch_id=patch.id %}"
78      >{{ patch.name }}</a></td>
79    <td>{{ patch.date|date:"Y-m-d" }}</td>
80    <td>{{ patch.submitter|personify }}</td>
81    <td>{{ patch.state }}</td>
82   </tr>
83  {% endfor %}
84 </table>
85
86 {% include "patchwork/pagination.html" %}
87
88 <div class="patchforms" id="patchforms" name="patchforms">
89
90 {% if patchform %}
91  <div class="patchform patchform-properties">
92   <h3>Properties</h3>
93     <table class="form">
94      <tr>
95       <th>Change state:</th>
96       <td>
97        {{ patchform.state }}
98        {{ patchform.state.errors }}
99       </td>
100      </tr>
101      <tr>
102       <th>Delegate to:</td>
103       <td>
104        {{ patchform.delegate }}
105        {{ patchform.delegate.errors }}
106       </td>
107      </tr>
108      <tr>
109       <th>Archive:</td>
110       <td>
111        {{ patchform.archived }}
112        {{ patchform.archived.errors }}
113       </td>
114      </tr>
115      <tr>
116       <td></td>
117       <td>
118        <input type="submit" name="action" value="Update"/>
119       </td>
120      </tr>
121     </table>
122  </div>
123
124 {% endif %}
125
126 {% if user.is_authenticated %}
127  <div class="patchform patchform-bundle">
128   <h3>Bundling</h3>
129    <table class="form">
130    <!--
131     <tr>
132      <td>Ack:</td>
133      <td>
134        <input type="submit" name="action" value="Ack"/>
135       </form>
136      </td>
137     </tr>
138     -->
139     <tr>
140      <td>Create bundle:</td>
141      <td>
142       <input type="text" name="bundle_name"/>
143       <input name="action" value="Create" type="submit"/>
144       </td>
145     </tr>
146   {% if bundles %}
147     <tr>
148      <td>Add to bundle:</td>
149      <td>
150        <select name="bundle_id"/>
151         {% for bundle in bundles %}
152          <option value="{{bundle.id}}">{{bundle.name}}</option>
153         {% endfor %}
154         </select>
155        <input name="action" value="Add" type="submit"/>
156      </td>
157     </tr>
158   {% endif %}
159   {% if bundle %}
160    <tr>
161      <td>Remove from bundle:</td>
162      <td>
163        <input type="hidden" name="removed_bundle_id" value="{{bundle.id}}"/>
164        <input name="action" value="Remove" type="submit"/>
165      </td>
166     </tr>
167   {% endif %}
168   </table>
169  </div>
170 {% endif %}
171
172
173  <div style="clear: both;">
174  </div>
175 </div>
176
177 {% else %}
178  <tr>
179   <td colspan="5">No patches to display</td>
180  </tr>
181 {% endif %}
182
183  </table>
184 </form>
185