]> git.parisson.com Git - teleforma.git/commitdiff
update answer list paginate
authoryomguy <yomguy@parisson.com>
Mon, 18 Feb 2013 19:30:20 +0000 (20:30 +0100)
committeryomguy <yomguy@parisson.com>
Mon, 18 Feb 2013 19:30:20 +0000 (20:30 +0100)
teleforma/templates/teleforma/inc/answer_list.html
teleforma/views/pro.py

index 5ef4a36b13b4c46e417590d0edc022cab6f6d309..4b5a7c9639a8e14bd8945e2fa6aa9fd858492742 100644 (file)
@@ -3,15 +3,8 @@
 {% load teleforma_tags %}
 {% load pagination_tags %}
 
-<div class="pagination">
-    {% for p in page.paginator.pages %}
-      {% if p == page %}
-       <span class="selected">{{ page }}</span>
-      {% else %}
-       <a href="?page={{ p.number }}">{{ p }}</a>
-      {% endif %}
-    {% endfor %}
-</div>
+{% autopaginate object_list %}
+{% paginate %}
 
 <div id="users">
   <table class="listing" width="100%">
@@ -21,7 +14,7 @@
     <th>{% trans "Seminar"%}</th>
     <th>{% trans "Date submitted"%}</th>
     <th>{% trans "Summary"%}</th>
-    <th>{% trans "Action / status"%}</th>
+    <th>{% trans "Status"%}</th>
     </tr>
     </thead>
     <tbody id="spacing">
      <td><a href="{% url teleforma-profile-detail answer.user.username %}">{{ answer.user.last_name }}</a></td>
      <td><a href="{% url teleforma-profile-detail answer.user.username %}">{{ answer.user.first_name }}</a></td>
 
-     <td>{{ answer.question.seminar }}</td>
+     <td>{{ answer.question.seminar.title }}</td>
      <td>{{ answer.date_submitted }}</td>
      <td><a href="{% url teleforma-answer-detail answer.id %}">{{ answer.answer|summary:120 }}</a></td>
      <td>{% if user.is_staff %}
-        <a id="validate" href="#" class="{% if answer.validated %}component_icon button icon_ok{% else %}component_icon button icon_delete{% endif %}" 
+        <a id="validate" href="#" class="{% if answer.validated %}component_icon button icon_ok{% else %}component_icon button icon_delete{% endif %}"
         onclick="var f = answerUtils;
             if ($(this).hasClass('icon_ok')) {f.reject('{{answer.id}}', $(this)); return false;}
             if ($(this).hasClass('icon_delete')) {f.validate('{{answer.id}}', $(this)); return false;}">
index 217cc4152a9c1f14c7f48201926b5fdaa424fe4d..688fe41e52bcaa50f2b136d7db28fac54a74babf 100644 (file)
@@ -272,7 +272,7 @@ class AnswersView(ListView):
 
     def get_context_data(self, **kwargs):
         context = super(AnswersView, self).get_context_data(**kwargs)
-        paginator = Paginator(self.object_list, per_page=12)
+        paginator = Paginator(self.object_list, per_page=10)
         try:
             page = int(self.request.GET.get('page', '1'))
         except ValueError: