Add some pagination on forum topics

This commit is contained in:
Skia
2017-03-12 20:24:16 +01:00
parent 65e2514df2
commit 729a3608ba
6 changed files with 43 additions and 6 deletions

View File

@@ -38,7 +38,13 @@
<p>{{ topic.description }}</p>
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
{% for m in topic.messages.select_related('author__avatar_pict').all() %}
<p style="text-align: right; background: #d8e7f3;">
{% for p in range(1, page_count + 1) %}
<span class="ib" style="background: {% if p == current_page %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
{% endfor %}
</p>
{% for m in msgs %}
{% if m.id == first_unread_message_id %}
<span id="first_unread"></span>
{% endif %}
@@ -50,6 +56,12 @@
{% endfor %}
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
<p style="text-align: right; background: #d8e7f3;">
{% for p in range(1, page_count + 1) %}
<span class="ib" style="background: {% if p == current_page %}white{% endif %}; margin: 0;"><a href="?page={{ p }}">{{ p }}</a></span>
{% endfor %}
</p>
{% endblock %}