From 92c58b56a94d4cd3484eb9f5e6393a67392700df Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 29 Feb 2024 12:23:00 -0600 Subject: Add more replies button --- static/js/controllers/comments_controller.js | 1 + templates/macros/pagination.jinja | 6 ++++++ templates/replies/index.jinja | 3 +++ 3 files changed, 10 insertions(+) diff --git a/static/js/controllers/comments_controller.js b/static/js/controllers/comments_controller.js index 5f454df..458ff43 100644 --- a/static/js/controllers/comments_controller.js +++ b/static/js/controllers/comments_controller.js @@ -52,6 +52,7 @@ export class CommentsController extends BaseController { async submit(event) { var form = new FormData(event.target); + form.set('content', form.get('content').trim()); form.append("domain", `${window.location.protocol}//${window.location.host}`); super.submit(event, `${this.comments_server_host}/api/comments?path=${this.post}`, form); diff --git a/templates/macros/pagination.jinja b/templates/macros/pagination.jinja index b53c0eb..04aa9cd 100644 --- a/templates/macros/pagination.jinja +++ b/templates/macros/pagination.jinja @@ -15,4 +15,10 @@ {% endif %} {% endfor %} +{% endmacro %} + +{% macro render_reply_pagination(pagination, comment_id) %} + {% if pagination.items and pagination.has_next %} + + {% endif %} {% endmacro %} \ No newline at end of file diff --git a/templates/replies/index.jinja b/templates/replies/index.jinja index c1fc6ea..eb99464 100644 --- a/templates/replies/index.jinja +++ b/templates/replies/index.jinja @@ -1,3 +1,5 @@ +{% import 'macros/pagination.jinja' as pagination %} +
{% for reply in page.items %}
@@ -18,4 +20,5 @@
{% endfor %} + {{ pagination.render_reply_pagination(page, comment.id) }}
-- cgit v1.2.3