Просмотр исходного кода

Remove unused pagination from threads lists templates (#1284)

* Remove unused pagination checks from page title

* Fix schema.org metadata for cursor based pagination
Rafał Pitoń 5 лет назад
Родитель
Сommit
29d0d87974

+ 0 - 1
misago/templates/misago/threadslist/base.html

@@ -43,7 +43,6 @@
         <div class="threads-list ui-ready">
           {% block threads-list %}
             <ul class="list-group" itemscope itemtype="http://schema.org/ItemList">
-              <meta itemprop="numberOfItems" content="{{ paginator.count }}">
               <meta itemprop="itemListOrder" content="http://schema.org/ItemListOrderDescending">
               {% for thread in threads %}
                 {% block thread %}

+ 1 - 7
misago/templates/misago/threadslist/category.html

@@ -4,13 +4,7 @@
 
 {% block title %}
   {% if list_name %}
-    {% if paginator.page > 1 %}
-      {{ list_name }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ category }} | {{ block.super }}
-    {% else %}
-      {{ list_name }} | {{ category }} | {{ block.super }}
-    {% endif %}
-  {% elif paginator.page > 1 %}
-    {{ category }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ block.super }}
+    {{ list_name }} | {{ category }} | {{ block.super }}
   {% else %}
     {{ category }} | {{ block.super }}
   {% endif %}

+ 1 - 7
misago/templates/misago/threadslist/private_threads.html

@@ -4,13 +4,7 @@
 
 {% block title %}
 {% if list_name %}
-  {% if paginator.page > 1 %}
-    {{ list_name }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ category }} | {{ block.super }}
-  {% else %}
-    {{ list_name }} | {{ category }} | {{ block.super }}
-  {% endif %}
-{% elif paginator.page > 1 %}
-  {{ category }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ block.super }}
+  {{ list_name }} | {{ category }} | {{ block.super }}
 {% else %}
   {{ category }} | {{ block.super }}
 {% endif %}

+ 5 - 2
misago/templates/misago/threadslist/thread.html

@@ -1,4 +1,4 @@
-{% load i18n misago_avatars misago_capture %}
+{% load i18n misago_absoluteurl misago_avatars misago_capture %}
 <li class="list-group-item {% if thread.category.css_class %}list-group-category-has-flavor list-group-item-category-{{ thread.category.css_class }}{% endif %} thread-{{ thread.is_read|yesno:'read,new' }}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
 
   <div class="thread-details-top">
@@ -212,5 +212,8 @@
       </div>
     </div>
   </div>
-  <meta itemprop="position" content="{{ paginator.before|add:forloop.counter }}">
+  
+  <meta itemprop="position" content="{{ list_page.start|add:forloop.counter }}">
+  <meta itemprop="url" content="{% absoluteurl thread.get_absolute_url %}">
+  <meta itemprop="name" content="{{ thread.title }}">
 </li>

+ 1 - 3
misago/templates/misago/threadslist/threads.html

@@ -3,7 +3,7 @@
 
 
 {% block title %}
-  {% if THREADS_ON_INDEX and paginator.page == 1 %}
+  {% if THREADS_ON_INDEX %}
     {% if list_name %}
       {{ list_name }} | {{ block.super }}
     {% else %}
@@ -12,8 +12,6 @@
   {% else %}
     {% if list_name %}
       {{ list_name }} | {% trans "Threads" %} | {{ block.super }}
-    {% elif paginator.page > 1 %}
-      {% trans "Threads" %} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ block.super }}
     {% else %}
       {% trans "Threads" %} | {{ block.super }}
     {% endif %}