]> git.ozlabs.org Git - patchwork/blobdiff - templates/patchwork/patch-list.html
templates/patch-list: add default text for patches with no name
[patchwork] / templates / patchwork / patch-list.html
index 0a15e9c7b39eec98aa11095afa55df8b3ab0661e..bc9abe943e62364bd1a5fbcea698e9e52c79467b 100644 (file)
@@ -9,6 +9,19 @@
   <td class="patchlistfilters">
  {% include "patchwork/filters.html" %}
   </td>
+ {% if order.editable %}
+  <td class="patchlistreorder">
+   <form method="post" id="reorderform">
+    <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>
 
 <form method="post">
 <input type="hidden" name="form" value="patchlistform"/>
 <input type="hidden" name="project" value="{{project.id}}"/>
-<table class="patchlist">
- <tr>
-  {% if patchform or bundle %}
-  <th/>
-  {% endif %}
-
-  <th>
-   {% ifequal order.name "name" %}
-    <a class="colactive"
-     href="{% listurl order=order.reversed_name %}">Patch</a>
-   {% else %}
-    <a class="colinactive" href="{% listurl order="name" %}">Patch</a>
-   {% endifequal %}
-  </th>
-
-  <th>
-   {% ifequal order.name "date" %}
-    <a class="colactive"
-     href="{% listurl order=order.reversed_name %}">Date</a>
-   {% else %}
-    <a class="colinactive" href="{% listurl order="date" %}">Date</a>
-   {% endifequal %}
-  </th>
-
-  <th>
-   {% ifequal order.name "submitter" %}
-    <a class="colactive"
-     href="{% listurl order=order.reversed_name %}">Submiter</a>
-   {% else %}
-    <a class="colinactive" href="{% listurl order="submitter" %}">Submitter</a>
-   {% endifequal %}
-  </th>
-
-  <th>
-   {% ifequal order.name "state" %}
-    <a class="colactive"
-     href="{% listurl order=order.reversed_name %}">State</a>
-   {% else %}
-    <a class="colinactive" href="{% listurl order="state" %}">State</a>
-   {% endifequal %}
-  </th>
+<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>
+  </tr>
+ </thead>
 
 {% if page %}
+ <tbody>
  {% for patch in page.object_list %}
-  <tr>
-    {% if patchform or bundle %}
+  <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 }}</a></td>
+     >{{ 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" %}