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