summaryrefslogtreecommitdiffstats
path: root/templates/patchwork/patch-list.html
blob: 59adbe3017215b029814bed149723baa336bb28f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
{% load person %}
{% load listurl %}

{% include "patchwork/pagination.html" %}


<table class="patchlist">
 <tr>
  <td class="patchlistfilters">
 {% include "patchwork/filters.html" %}
  </td>
 {% if order.editable %}
  <td class="patchlistreorder">
   <form method="post" id="reorderform">
    {% csrf_token %}
    <input type="hidden" name="form" value="reorderform"/>
    <input type="hidden" name="order_start" value="0"/>
    <span id="reorderhelp"></span>
    <input id="reorder-cancel" type="button" value="Cancel"
     onClick="order_cancel_click(this)"/>
    <input id="reorder-change" type="button" value="Change order"
     onClick="order_button_click(this)"/>
    </form>
  </td>
 {% endif %}
 </tr>
</table>

{% if page.paginator.long_page and user.is_authenticated %}
<div class="floaty">
 <a title="jump to form" href="#patchforms"><span
  style="font-size: 120%">&#9662;</span></a>
</div>
{% endif %}

<form method="post">
{% csrf_token %}
<input type="hidden" name="form" value="patchlistform"/>
<input type="hidden" name="project" value="{{project.id}}"/>
<table class="patchlist" id="patchlist">
 <thead>
  <tr>
   {% if user.is_authenticated %}
   <th>
    <input type="checkbox" onChange="select_all(this)"/>
   </th>
   {% endif %}

   <th>
    {% ifequal order.name "name" %}
     <a class="colactive"
      href="{% listurl order=order.reversed_name %}"><img
      src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
      width="16" height="16"
     ></a> <a class="colactive"
      href="{% listurl order=order.reversed_name %}">Patch</a>
    {% else %}
     {% if not order.editable %}
     <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
     {% else %}
     <span class="colinactive">Patch</span>
     {% endif %}
    {% endifequal %}
   </th>

   <th>
    {% ifequal order.name "date" %}
     <a class="colactive"
      href="{% listurl order=order.reversed_name %}"><img
      src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
      width="16" height="16"
     ></a> <a class="colactive"
      href="{% listurl order=order.reversed_name %}">Date</a>
    {% else %}
     {% if not order.editable %}
     <a class="colinactive" href="{% listurl order="date" %}">Date</a>
     {% else %}
     <span class="colinactive">Date</span>
     {% endif %}
    {% endifequal %}
   </th>

   <th>
    {% ifequal order.name "submitter" %}
     <a class="colactive"
      href="{% listurl order=order.reversed_name %}"><img
      src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
      width="16" height="16"
     ></a> <a class="colactive"
      href="{% listurl order=order.reversed_name %}">Submitter</a>
    {% else %}
     {% if not order.editable %}
     <a class="colinactive" href="{% listurl order="submitter" %}">Submitter</a>
     {% else %}
     <span class="colinactive">Submitter</span>
     {% endif %}
    {% endifequal %}
   </th>

   <th>
    {% ifequal order.name "delegate" %}
     <a class="colactive"
      href="{% listurl order=order.reversed_name %}"><img
      src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
      width="16" height="16"
     ></a> <a class="colactive"
      href="{% listurl order=order.reversed_name %}">Delegate</a>
    {% else %}
     {% if not order.editable %}
     <a class="colinactive" href="{% listurl order="delegate" %}">Delegate</a>
     {% else %}
     <span class="colinactive">Delegate</span>
     {% endif %}
    {% endifequal %}
   </th>

   <th>
    {% ifequal order.name "state" %}
     <a class="colactive"
      href="{% listurl order=order.reversed_name %}"><img
      src="/images/16-arrow-{% if order.reversed %}up{% else %}down{%endif%}.png"
      width="16" height="16"
     ></a> <a class="colactive"
      href="{% listurl order=order.reversed_name %}">State</a>
    {% else %}
     {% if not order.editable %}
     <a class="colinactive" href="{% listurl order="state" %}">State</a>
     {% else %}
     <span class="colinactive">State</span>
     {% endif %}
    {% endifequal %}
   </th>

  </tr>
 </thead>

{% if page.paginator.count %}
 <tbody>
 {% for patch in page.object_list %}
  <tr id="patch_row:{{patch.id}}" class="{% cycle 'odd' 'even' %}">
    {% if user.is_authenticated %}
    <td>
    <input type="checkbox" name="patch_id:{{patch.id}}"/>
    </td>
    {% endif %}
   <td><a href="{% url 'patchwork.views.patch.patch' patch_id=patch.id %}"
     >{{ patch.name|default:"[no subject]" }}</a></td>
   <td>{{ patch.date|date:"Y-m-d" }}</td>
   <td>{{ patch.submitter|personify }}</td>
   <td>{{ patch.delegate.username }}</td>
   <td>{{ patch.state }}</td>
  </tr>
 {% endfor %}
 </tbody>
</table>

{% include "patchwork/pagination.html" %}

<div class="patchforms" id="patchforms" name="patchforms">

{% if patchform %}
 <div class="patchform patchform-properties">
  <h3>Properties</h3>
    <table class="form">
     <tr>
      <th>Change state:</th>
      <td>
       {{ patchform.state }}
       {{ patchform.state.errors }}
      </td>
     </tr>
     <tr>
      <th>Delegate to:</td>
      <td>
       {{ patchform.delegate }}
       {{ patchform.delegate.errors }}
      </td>
     </tr>
     <tr>
      <th>Archive:</td>
      <td>
       {{ patchform.archived }}
       {{ patchform.archived.errors }}
      </td>
     </tr>
     <tr>
      <td></td>
      <td>
       <input type="submit" name="action" value="{{patchform.action}}"/>
      </td>
     </tr>
    </table>
 </div>

{% endif %}

{% if user.is_authenticated %}
 <div class="patchform patchform-bundle">
  <h3>Bundling</h3>
   <table class="form">
    <tr>
     <td>Create bundle:</td>
     <td>
      <input type="text" name="bundle_name"/>
      <input name="action" value="Create" type="submit"/>
      </td>
    </tr>
  {% if bundles %}
    <tr>
     <td>Add to bundle:</td>
     <td>
       <select name="bundle_id"/>
        {% for bundle in bundles %}
         <option value="{{bundle.id}}">{{bundle.name}}</option>
        {% endfor %}
        </select>
       <input name="action" value="Add" type="submit"/>
     </td>
    </tr>
  {% endif %}
  {% if bundle %}
   <tr>
     <td>Remove from bundle:</td>
     <td>
       <input type="hidden" name="removed_bundle_id" value="{{bundle.id}}"/>
       <input name="action" value="Remove" type="submit"/>
     </td>
    </tr>
  {% endif %}
  </table>
 </div>
{% endif %}


 <div style="clear: both;">
 </div>
</div>

{% else %}
 <tr>
  <td colspan="5">No patches to display</td>
 </tr>
{% endif %}

 </table>
</form>