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