added checkbox option
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Fri, 28 Feb 2014 19:11:49 +0000 (20:11 +0100)
committerCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Fri, 28 Feb 2014 19:11:49 +0000 (20:11 +0100)
rest/templates/table-default.html

index aeed984..da7ba0c 100644 (file)
@@ -1,21 +1,15 @@
 {% load rest_filters %}
 <thead>
 <tr>
-       {% for p in properties %}
-       <th>
-               {{ p }}
-       </th>
-       {% endfor %}
+       {% if "checkbox" in options %}<th>checkbox</th>{% endif %}
+       {% for p in properties %}<th>{{ p }}</th>{% endfor %}
 </tr>
 </thead>
 <tbody>
 {% for d in data %}
-<tr>
-       {% for p in properties %}
-       <td>
-               <div class="line1">{{ d|key:p }}</div>
-       </td>
-       {% endfor %}
+<tr id="{{ id }}">
+       {% if "checkbox" in options %}<td><input type="checkbox" name="{{ id }}" /></td>{% endif %}
+       {% for p in properties %}<td><div class="line1">{{ d|key:p }}</div></td>{% endfor %}
 </tr>
 {% endfor %}
 </tbody>
\ No newline at end of file