fix history display when no pagination
authorraph
Wed, 05 May 2010 10:51:52 +0200
changeset 265 1d4299775ec9
parent 264 b545c82610df
child 266 33eb2ee6b9de
fix history display when no pagination
src/cm/templates/site/text_history.html
--- a/src/cm/templates/site/text_history.html	Thu Apr 22 18:09:44 2010 +0200
+++ b/src/cm/templates/site/text_history.html	Wed May 05 10:51:52 2010 +0200
@@ -84,6 +84,8 @@
         </tr>
     </thead>
     <tbody>
+    	{% with object_list|length as object_list_len %}
+    	
         {% for text_version in object_list %}
         
         {% get_local_text_perm request text can_edit_text as can_edit_text %}
@@ -92,7 +94,7 @@
         
         <tr class="text-{{ text_version.key }} {% cycle 'odd' 'even' %}">
             {% if can_manage_workspace %}<td><input type="checkbox" class="text_check" name="check-{{ text_version.key }}"/></td>{% endif %}
-            <td>#{{ forloop.counter0|add:page_obj.start_index|invneg:paginator.count|add:"1" }}</td>
+            <td>#{% if page_obj %}{{ forloop.counter0|add:page_obj.start_index|invneg:paginator.count|add:"1" }}{% else %}{{ forloop.counter0|invneg:object_list_len }}{% endif %}</td>
             <td><input id="oldkey-{{ forloop.counter0 }}" type="radio" name="oldkey" value="{{ text_version.key }}"/></td>
             <td><input id="newkey-{{ forloop.counter0 }}" type="radio" name="newkey" value="{{ text_version.key }}"/></td>                        
             <td>
@@ -159,6 +161,8 @@
 
         </tr>
         {% endfor %}
+        
+        {% endwith %}
     </tbody>
 </table>