فهرست منبع

fix public index pagination links and total count

Nick Sweeting 4 سال پیش
والد
کامیت
de1a939df4
1فایلهای تغییر یافته به همراه15 افزوده شده و 10 حذف شده
  1. 15 10
      archivebox/templates/core/public_index.html

+ 15 - 10
archivebox/templates/core/public_index.html

@@ -2,6 +2,11 @@
 {% load static %}
 {% load static %}
 
 
 {% block body %}
 {% block body %}
+    <style>
+        #table-bookmarks_info {
+            display: none;
+        }
+    </style>
     <div id="toolbar">
     <div id="toolbar">
         <form id="changelist-search" action="{% url 'public-index' %}" method="get">
         <form id="changelist-search" action="{% url 'public-index' %}" method="get">
             <div>
             <div>
@@ -21,7 +26,7 @@
         <thead>
         <thead>
             <tr>
             <tr>
                 <th style="width: 100px;">Bookmarked</th>
                 <th style="width: 100px;">Bookmarked</th>
-                <th style="width: 26vw;">Snapshot ({{object_list|length}})</th>
+                <th style="width: 26vw;">Snapshot ({{page_obj.paginator.count}})</th>
                 <th style="width: 140px">Files</th>
                 <th style="width: 140px">Files</th>
                 <th style="width: 16vw;whitespace:nowrap;overflow-x:hidden;">Original URL</th>
                 <th style="width: 16vw;whitespace:nowrap;overflow-x:hidden;">Original URL</th>
             </tr>
             </tr>
@@ -33,26 +38,26 @@
             </tbody>
             </tbody>
         </table>
         </table>
         <center>
         <center>
+            <br/>
+            Showing {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} total
+            <br/>
             <span class="step-links">
             <span class="step-links">
                 {% if page_obj.has_previous %}
                 {% if page_obj.has_previous %}
-                    <a href="{% url 'public-index' %}?page=1">&laquo; first</a>
+                    <a href="{% url 'public-index' %}?page=1">&laquo; first</a> &nbsp;
                     <a href="{% url 'public-index' %}?page={{ page_obj.previous_page_number }}">previous</a>
                     <a href="{% url 'public-index' %}?page={{ page_obj.previous_page_number }}">previous</a>
+                    &nbsp;
                 {% endif %}
                 {% endif %}
         
         
                 <span class="current">
                 <span class="current">
-                    Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
+                    Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
                 </span>
                 </span>
-        
+            
                 {% if page_obj.has_next %}
                 {% if page_obj.has_next %}
-                    <a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a>
+                    &nbsp;
+                    <a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a> &nbsp;
                     <a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
                     <a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
                 {% endif %}
                 {% endif %}
             </span>
             </span>
-    
-            {% if page_obj.has_next %}
-                <a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a>
-                <a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
-            {% endif %}
         </span>
         </span>
         <br>
         <br>
     </center>
     </center>