diff options
author | Gabriel RodrÃguez Alberich | 2022-12-17 01:06:29 +0100 |
---|---|---|
committer | GitHub | 2022-12-16 17:06:29 -0700 |
commit | fb2eea956ef7416eb755ebecf58db7f9a57215c4 (patch) | |
tree | 0ca587705b99d7caab12bdb3557874c8c41e8356 /templates/activities | |
parent | 45c6978bc397691b22db0360b16b19979eac7dce (diff) | |
download | takahe-fb2eea956ef7416eb755ebecf58db7f9a57215c4.tar.gz takahe-fb2eea956ef7416eb755ebecf58db7f9a57215c4.tar.bz2 takahe-fb2eea956ef7416eb755ebecf58db7f9a57215c4.zip |
Several pagination improvements (#170)
Home/Notification gets pagination, Follows becomes ListView
Diffstat (limited to 'templates/activities')
-rw-r--r-- | templates/activities/follows.html | 16 | ||||
-rw-r--r-- | templates/activities/home.html | 12 | ||||
-rw-r--r-- | templates/activities/local.html | 12 | ||||
-rw-r--r-- | templates/activities/notifications.html | 12 | ||||
-rw-r--r-- | templates/activities/tag.html | 12 |
5 files changed, 51 insertions, 13 deletions
diff --git a/templates/activities/follows.html b/templates/activities/follows.html index 18c7811..e2c0ece 100644 --- a/templates/activities/follows.html +++ b/templates/activities/follows.html @@ -4,17 +4,17 @@ {% block content %} <section class="icon-menu"> - {% for identity, details in identities %} + {% for identity, follow_type in page_obj %} <a class="option" href="{{ identity.urls.view }}"> <img src="{{ identity.local_icon_url.relative }}"> <span class="handle"> {{ identity.html_name_or_handle }} <small>@{{ identity.handle }}</small> </span> - {% if details.outbound %} + {% if follow_type == "outbound" %} <span class="pill">Following</span> {% endif %} - {% if details.inbound %} + {% if follow_type == "inbound" %} <span class="pill">Follows You</span> {% endif %} </a> @@ -22,4 +22,14 @@ <p class="option empty">You have no follows.</p> {% endfor %} </section> + + <div class="pagination"> + {% if page_obj.has_previous %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a></div> + {% endif %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} + </div> {% endblock %} diff --git a/templates/activities/home.html b/templates/activities/home.html index 546da0d..06fa88c 100644 --- a/templates/activities/home.html +++ b/templates/activities/home.html @@ -4,7 +4,7 @@ {% block title %}Home{% endblock %} {% block content %} - {% for event in events %} + {% for event in page_obj %} {% if event.type == "post" %} {% include "activities/_post.html" with post=event.subject_post %} {% elif event.type == "boost" %} @@ -21,4 +21,14 @@ {% empty %} Nothing to show yet. {% endfor %} + + <div class="pagination"> + {% if page_obj.has_previous %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a></div> + {% endif %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} + </div> {% endblock %} diff --git a/templates/activities/local.html b/templates/activities/local.html index c03b0c0..c3d180b 100644 --- a/templates/activities/local.html +++ b/templates/activities/local.html @@ -9,7 +9,13 @@ No posts yet. {% endfor %} - {% if page_obj.has_next %} - <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> - {% endif %} + <div class="pagination"> + {% if page_obj.has_previous %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a></div> + {% endif %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} + </div> {% endblock %} diff --git a/templates/activities/notifications.html b/templates/activities/notifications.html index 890a2ad..89ca4d8 100644 --- a/templates/activities/notifications.html +++ b/templates/activities/notifications.html @@ -32,7 +32,13 @@ No notifications yet. {% endfor %} - {% if page_obj.has_next %} - <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> - {% endif %} + <div class="pagination"> + {% if page_obj.has_previous %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a></div> + {% endif %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} + </div> {% endblock %} diff --git a/templates/activities/tag.html b/templates/activities/tag.html index a319b6a..f0684f0 100644 --- a/templates/activities/tag.html +++ b/templates/activities/tag.html @@ -10,7 +10,13 @@ No posts yet. {% endfor %} - {% if page_obj.has_next %} - <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> - {% endif %} + <div class="pagination"> + {% if page_obj.has_previous %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.previous_page_number }}">Previous Page</a></div> + {% endif %} + + {% if page_obj.has_next %} + <div class="load-more"><a class="button" href=".?page={{ page_obj.next_page_number }}">Next Page</a></div> + {% endif %} + </div> {% endblock %} |