From bfd33c397d30c60cde16d5073382bdae94d475cd Mon Sep 17 00:00:00 2001
From: adityacp
Date: Mon, 27 Apr 2020 14:48:12 +0530
Subject: Fix pagination for forum post search
---
yaksh/templates/yaksh/course_forum.html | 52 ++++++++++++++++++++++----------
yaksh/templates/yaksh/paginator.html | 6 ++--
yaksh/templates/yaksh/post_comments.html | 7 +++--
3 files changed, 44 insertions(+), 21 deletions(-)
(limited to 'yaksh/templates')
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html
index e6b6a90..4724981 100644
--- a/yaksh/templates/yaksh/course_forum.html
+++ b/yaksh/templates/yaksh/course_forum.html
@@ -12,23 +12,19 @@
-
-
-
+
+
@@ -58,12 +54,34 @@
+
+ {% with objects as posts %}
{% if posts %}
+ {% include "yaksh/paginator.html" %}
+
- Questions |
+ Posts |
Created by |
Replies |
Last reply |
@@ -98,10 +116,12 @@
{% endfor %}
+
+ {% include "yaksh/paginator.html" %}
{% else %}
No discussion posts are there yet. Create one to start discussing.
{% endif %}
- {% include "yaksh/paginator.html" %}
+ {% endwith %}
{% endblock content %}
{% block script %}
diff --git a/yaksh/templates/yaksh/paginator.html b/yaksh/templates/yaksh/paginator.html
index e958519..e18cbce 100644
--- a/yaksh/templates/yaksh/paginator.html
+++ b/yaksh/templates/yaksh/paginator.html
@@ -2,7 +2,7 @@
{% if objects.has_previous %}
+ {% if request.GET.search_tags %}&search_tags={{ request.GET.search_tags }}{% endif %}{% if request.GET.search_status %}&search_status={{ request.GET.search_status }}{% endif %}{% if request.GET.search_post %}&search_post={{ request.GET.search_post }}{% endif %}" aria-label="Previous">
@@ -17,13 +17,13 @@
{{ n }}(current)
{% elif n > objects.number|add:'-5' and n < objects.number|add:'5' %}
- {{ n }}
+ {{ n }}
{% endif %}
{% endfor %}
{% if objects.has_next %}
-
+
diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html
index 463103e..b16b80c 100644
--- a/yaksh/templates/yaksh/post_comments.html
+++ b/yaksh/templates/yaksh/post_comments.html
@@ -6,7 +6,9 @@
{% block content %}