]> git.ozlabs.org Git - patchwork/blob - templates/patchwork/patch-list.html
Initial bundle reordering support
[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" id="patchlist">
26  <thead>
27   <tr>
28    {% if user.is_authenticated %}
29    <th>
30     <input type="checkbox" onChange="select_all(this)"/>
31    </th>
32    {% endif %}
33
34    <th>
35     {% ifequal order.name "name" %}
36      <a class="colactive"
37       href="{% listurl order=order.reversed_name %}"><img
38       src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
39       width="16" height="16"
40      ></a> <a class="colactive"
41       href="{% listurl order=order.reversed_name %}">Patch</a>
42     {% else %}
43      <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
44     {% endifequal %}
45    </th>
46
47    <th>
48     {% ifequal order.name "date" %}
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 %}">Date</a>
55     {% else %}
56      <a class="colinactive" href="{% listurl order="date" %}">Date</a>
57     {% endifequal %}
58    </th>
59
60    <th>
61     {% ifequal order.name "submitter" %}
62      <a class="colactive"
63       href="{% listurl order=order.reversed_name %}"><img
64       src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
65       width="16" height="16"
66      ></a> <a class="colactive"
67       href="{% listurl order=order.reversed_name %}">Submitter</a>
68     {% else %}
69      <a class="colinactive" href="{% listurl order="submitter" %}">Submitter</a>
70     {% endifequal %}
71    </th>
72
73    <th>
74     {% ifequal order.name "delegate" %}
75      <a class="colactive"
76       href="{% listurl order=order.reversed_name %}"><img
77       src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
78       width="16" height="16"
79      ></a> <a class="colactive"
80       href="{% listurl order=order.reversed_name %}">Delegate</a>
81     {% else %}
82      <a class="colinactive" href="{% listurl order="delegate" %}">Delegate</a>
83     {% endifequal %}
84    </th>
85
86    <th>
87     {% ifequal order.name "state" %}
88      <a class="colactive"
89       href="{% listurl order=order.reversed_name %}"><img
90       src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
91       width="16" height="16"
92      ></a> <a class="colactive"
93       href="{% listurl order=order.reversed_name %}">State</a>
94     {% else %}
95      <a class="colinactive" href="{% listurl order="state" %}">State</a>
96     {% endifequal %}
97    </th>
98
99   </tr>
100  </thead>
101
102 {% if page %}
103  <tbody>
104  {% for patch in page.object_list %}
105   <tr id="patch_row:{{patch.id}}" class="{% cycle 'odd' 'even' %}">
106     {% if user.is_authenticated %}
107     <td>
108     <input type="checkbox" name="patch_id:{{patch.id}}"/>
109     </td>
110     {% endif %}
111    <td><a href="{% url patchwork.views.patch.patch patch_id=patch.id %}"
112      >{{ patch.name }}</a></td>
113    <td>{{ patch.date|date:"Y-m-d" }}</td>
114    <td>{{ patch.submitter|personify }}</td>
115    <td>{{ patch.delegate.username }}</td>
116    <td>{{ patch.state }}</td>
117   </tr>
118  {% endfor %}
119  </tbody>
120 </table>
121
122 {% include "patchwork/pagination.html" %}
123
124 <div class="patchforms" id="patchforms" name="patchforms">
125
126 {% if patchform %}
127  <div class="patchform patchform-properties">
128   <h3>Properties</h3>
129     <table class="form">
130      <tr>
131       <th>Change state:</th>
132       <td>
133        {{ patchform.state }}
134        {{ patchform.state.errors }}
135       </td>
136      </tr>
137      <tr>
138       <th>Delegate to:</td>
139       <td>
140        {{ patchform.delegate }}
141        {{ patchform.delegate.errors }}
142       </td>
143      </tr>
144      <tr>
145       <th>Archive:</td>
146       <td>
147        {{ patchform.archived }}
148        {{ patchform.archived.errors }}
149       </td>
150      </tr>
151      <tr>
152       <td></td>
153       <td>
154        <input type="submit" name="action" value="Update"/>
155       </td>
156      </tr>
157     </table>
158  </div>
159
160 {% endif %}
161
162 {% if user.is_authenticated %}
163  <div class="patchform patchform-bundle">
164   <h3>Bundling</h3>
165    <table class="form">
166    <!--
167     <tr>
168      <td>Ack:</td>
169      <td>
170        <input type="submit" name="action" value="Ack"/>
171       </form>
172      </td>
173     </tr>
174     -->
175     <tr>
176      <td>Create bundle:</td>
177      <td>
178       <input type="text" name="bundle_name"/>
179       <input name="action" value="Create" type="submit"/>
180       </td>
181     </tr>
182   {% if bundles %}
183     <tr>
184      <td>Add to bundle:</td>
185      <td>
186        <select name="bundle_id"/>
187         {% for bundle in bundles %}
188          <option value="{{bundle.id}}">{{bundle.name}}</option>
189         {% endfor %}
190         </select>
191        <input name="action" value="Add" type="submit"/>
192      </td>
193     </tr>
194   {% endif %}
195   {% if bundle %}
196    <tr>
197      <td>Remove from bundle:</td>
198      <td>
199        <input type="hidden" name="removed_bundle_id" value="{{bundle.id}}"/>
200        <input name="action" value="Remove" type="submit"/>
201      </td>
202     </tr>
203   {% endif %}
204   </table>
205  </div>
206 {% endif %}
207
208
209  <div style="clear: both;">
210  </div>
211 </div>
212
213 {% else %}
214  <tr>
215   <td colspan="5">No patches to display</td>
216  </tr>
217 {% endif %}
218
219  </table>
220 </form>
221