]> git.ozlabs.org Git - patchwork/blob - patchwork/templates/patchwork/patch-list.html
Add patch tag infrastructure
[patchwork] / patchwork / templates / patchwork / patch-list.html
1 {% load person %}
2 {% load listurl %}
3 {% load patch %}
4 {% load static %}
5
6 {% include "patchwork/pagination.html" %}
7
8
9 <table class="patchlist">
10  <tr>
11   <td class="patchlistfilters">
12  {% include "patchwork/filters.html" %}
13   </td>
14  {% if order.editable %}
15   <td class="patchlistreorder">
16    <form method="post" id="reorderform">
17     {% csrf_token %}
18     <input type="hidden" name="form" value="reorderform"/>
19     <input type="hidden" name="order_start" value="0"/>
20     <span id="reorderhelp"></span>
21     <input id="reorder-cancel" type="button" value="Cancel"
22      onClick="order_cancel_click(this)"/>
23     <input id="reorder-change" type="button" value="Change order"
24      onClick="order_button_click(this)"/>
25     </form>
26   </td>
27  {% endif %}
28  </tr>
29 </table>
30
31 {% if page.paginator.long_page and user.is_authenticated %}
32 <div class="floaty">
33  <a title="jump to form" href="#patchforms"><span
34   style="font-size: 120%">&#9662;</span></a>
35 </div>
36 {% endif %}
37
38 <form method="post">
39 {% csrf_token %}
40 <input type="hidden" name="form" value="patchlistform"/>
41 <input type="hidden" name="project" value="{{project.id}}"/>
42 <table class="patchlist" id="patchlist">
43  <thead>
44   <tr>
45    {% if user.is_authenticated %}
46    <th>
47     <input type="checkbox" onChange="select_all(this)"/>
48    </th>
49    {% endif %}
50
51    <th>
52     {% ifequal order.name "name" %}
53      <a class="colactive"
54       href="{% listurl order=order.reversed_name %}"><img
55       {% if order.reversed %}
56       src="{% static "images/16-arrow-up.png" %}"
57       {% else %}
58       src="{% static "images/16-arrow-down.png" %}"
59       {%endif%}
60       width="16" height="16"
61      ></a> <a class="colactive"
62       href="{% listurl order=order.reversed_name %}">Patch</a>
63     {% else %}
64      {% if not order.editable %}
65      <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
66      {% else %}
67      <span class="colinactive">Patch</span>
68      {% endif %}
69     {% endifequal %}
70    </th>
71
72    <th>
73     <span
74      title="{% for tag in project.tags %}{{tag.name}}{% if not forloop.last %} / {% endif %}{% endfor %}"
75      >{% for tag in project.tags %}{{tag.abbrev}}{% if not forloop.last %}/{% endif %}{% endfor %}</span>
76    </th>
77
78    <th>
79     {% ifequal order.name "date" %}
80      <a class="colactive"
81       href="{% listurl order=order.reversed_name %}"><img
82       {% if order.reversed %}
83       src="{% static "images/16-arrow-up.png" %}"
84       {% else %}
85       src="{% static "images/16-arrow-down.png" %}"
86       {%endif%}
87       width="16" height="16"
88      ></a> <a class="colactive"
89       href="{% listurl order=order.reversed_name %}">Date</a>
90     {% else %}
91      {% if not order.editable %}
92      <a class="colinactive" href="{% listurl order="date" %}">Date</a>
93      {% else %}
94      <span class="colinactive">Date</span>
95      {% endif %}
96     {% endifequal %}
97    </th>
98
99    <th>
100     {% ifequal order.name "submitter" %}
101      <a class="colactive"
102       href="{% listurl order=order.reversed_name %}"><img
103       {% if order.reversed %}
104       src="{% static "images/16-arrow-up.png" %}"
105       {% else %}
106       src="{% static "images/16-arrow-down.png" %}"
107       {%endif%}
108       width="16" height="16"
109      ></a> <a class="colactive"
110       href="{% listurl order=order.reversed_name %}">Submitter</a>
111     {% else %}
112      {% if not order.editable %}
113      <a class="colinactive" href="{% listurl order="submitter" %}">Submitter</a>
114      {% else %}
115      <span class="colinactive">Submitter</span>
116      {% endif %}
117     {% endifequal %}
118    </th>
119
120    <th>
121     {% ifequal order.name "delegate" %}
122      <a class="colactive"
123       href="{% listurl order=order.reversed_name %}"><img
124       {% if order.reversed %}
125       src="{% static "images/16-arrow-up.png" %}"
126       {% else %}
127       src="{% static "images/16-arrow-down.png" %}"
128       {%endif%}
129       width="16" height="16"
130      ></a> <a class="colactive"
131       href="{% listurl order=order.reversed_name %}">Delegate</a>
132     {% else %}
133      {% if not order.editable %}
134      <a class="colinactive" href="{% listurl order="delegate" %}">Delegate</a>
135      {% else %}
136      <span class="colinactive">Delegate</span>
137      {% endif %}
138     {% endifequal %}
139    </th>
140
141    <th>
142     {% ifequal order.name "state" %}
143      <a class="colactive"
144       href="{% listurl order=order.reversed_name %}"><img
145       {% if order.reversed %}
146       src="{% static "images/16-arrow-up.png" %}"
147       {% else %}
148       src="{% static "images/16-arrow-down.png" %}"
149       {%endif%}
150       width="16" height="16"
151      ></a> <a class="colactive"
152       href="{% listurl order=order.reversed_name %}">State</a>
153     {% else %}
154      {% if not order.editable %}
155      <a class="colinactive" href="{% listurl order="state" %}">State</a>
156      {% else %}
157      <span class="colinactive">State</span>
158      {% endif %}
159     {% endifequal %}
160    </th>
161
162   </tr>
163  </thead>
164
165 {% if page.paginator.count %}
166  <tbody>
167  {% for patch in page.object_list %}
168   <tr id="patch_row:{{patch.id}}" class="{% cycle 'odd' 'even' %}">
169     {% if user.is_authenticated %}
170     <td>
171     <input type="checkbox" name="patch_id:{{patch.id}}"/>
172     </td>
173     {% endif %}
174    <td><a href="{% url 'patchwork.views.patch.patch' patch_id=patch.id %}"
175      >{{ patch.name|default:"[no subject]" }}</a></td>
176    <td style="white-space: nowrap;">{{ patch|patch_tags }}</td>
177    <td>{{ patch.date|date:"Y-m-d" }}</td>
178    <td>{{ patch.submitter|personify:project }}</td>
179    <td>{{ patch.delegate.username }}</td>
180    <td>{{ patch.state }}</td>
181   </tr>
182  {% endfor %}
183  </tbody>
184 </table>
185
186 {% include "patchwork/pagination.html" %}
187
188 <div class="patchforms" id="patchforms" name="patchforms">
189
190 {% if patchform %}
191  <div class="patchform patchform-properties">
192   <h3>Properties</h3>
193     <table class="form">
194      <tr>
195       <th>Change state:</th>
196       <td>
197        {{ patchform.state }}
198        {{ patchform.state.errors }}
199       </td>
200      </tr>
201      <tr>
202       <th>Delegate to:</td>
203       <td>
204        {{ patchform.delegate }}
205        {{ patchform.delegate.errors }}
206       </td>
207      </tr>
208      <tr>
209       <th>Archive:</td>
210       <td>
211        {{ patchform.archived }}
212        {{ patchform.archived.errors }}
213       </td>
214      </tr>
215      <tr>
216       <td></td>
217       <td>
218        <input type="submit" name="action" value="{{patchform.action}}"/>
219       </td>
220      </tr>
221     </table>
222  </div>
223
224 {% endif %}
225
226 {% if user.is_authenticated %}
227  <div class="patchform patchform-bundle">
228   <h3>Bundling</h3>
229    <table class="form">
230     <tr>
231      <td>Create bundle:</td>
232      <td>
233       <input type="text" name="bundle_name"/>
234       <input name="action" value="Create" type="submit"/>
235       </td>
236     </tr>
237   {% if bundles %}
238     <tr>
239      <td>Add to bundle:</td>
240      <td>
241        <select name="bundle_id"/>
242         {% for bundle in bundles %}
243          <option value="{{bundle.id}}">{{bundle.name}}</option>
244         {% endfor %}
245         </select>
246        <input name="action" value="Add" type="submit"/>
247      </td>
248     </tr>
249   {% endif %}
250   {% if bundle %}
251    <tr>
252      <td>Remove from bundle:</td>
253      <td>
254        <input type="hidden" name="removed_bundle_id" value="{{bundle.id}}"/>
255        <input name="action" value="Remove" type="submit"/>
256      </td>
257     </tr>
258   {% endif %}
259   </table>
260  </div>
261 {% endif %}
262
263
264  <div style="clear: both;">
265  </div>
266 </div>
267
268 {% else %}
269  <tr>
270   <td colspan="6">No patches to display</td>
271  </tr>
272 {% endif %}
273
274  </table>
275 </form>
276