diff --git a/templates/comments/_comment.html b/templates/comments/_comment.html index b81b322..5777495 100644 --- a/templates/comments/_comment.html +++ b/templates/comments/_comment.html @@ -1,26 +1,42 @@ -
-
-
-
-
{{ comment.author_name }}
-
{{ comment.created_at|date:"M j, Y" }}
-
-
-

{{ comment.body }}

- {% include "comments/_reactions.html" with comment=comment counts=comment.reaction_counts user_reacted=comment.user_reacted %} -
- {% for reply in comment.replies.all %} -
-
-
-
-
{{ reply.author_name }}
-
{{ reply.created_at|date:"M j, Y" }}
+
+ +
+
+
+
+
+ {{ comment.author_name }} + +
+
+ {{ comment.body|linebreaks }} +
-

{{ reply.body }}

+ +
+ {% include "comments/_reactions.html" with comment=comment counts=comment.reaction_counts user_reacted=comment.user_reacted %} + +
+ + + + + Reply + + + +
+ {% include "comments/_reply_form.html" with page=page comment=comment %} +
+
+
- {% endfor %} + + +
+ {% for reply in comment.replies.all %} + {% include "comments/_reply.html" with reply=reply %} + {% endfor %}
- {% include "comments/_reply_form.html" with page=page comment=comment %} -
+
diff --git a/templates/comments/_comment_form.html b/templates/comments/_comment_form.html index 0242865..bb54e97 100644 --- a/templates/comments/_comment_form.html +++ b/templates/comments/_comment_form.html @@ -1,42 +1,66 @@ {% load static %} -
-

Post a Comment

- {% if success_message %} -
- {{ success_message }} -
- {% endif %} - {% if comment_form.errors %} -
- {% for error in comment_form.non_field_errors %}

{{ error }}

{% endfor %} - {% for field in comment_form %}{% for error in field.errors %}

{{ field.label }}: {{ error }}

{% endfor %}{% endfor %} -
- {% endif %} -
- {% csrf_token %} - -
-
- - -
-
- - -
+
+
+

Join the conversation

+

Add your fresh comment below

+ + {% if success_message %} +
+ {{ success_message }}
-
- - -
- - {% if turnstile_site_key %} -
{% endif %} - - + + {% if comment_form.errors %} +
+
There were some errors:
+
    + {% if comment_form.non_field_errors %} + {% for error in comment_form.non_field_errors %}
  • {{ error }}
  • {% endfor %} + {% endif %} + {% for field in comment_form %} + {% if field.errors %} + {% for error in field.errors %}
  • {{ field.label }}: {{ error }}
  • {% endfor %} + {% endif %} + {% endfor %} +
+
+ {% endif %} + +
+ {% csrf_token %} + +
+
+ + +
+
+ + +
+
+
+ + +
+ + + {% if turnstile_site_key %} +
+ {% endif %} + +
+ +
+
+
diff --git a/templates/comments/_comment_list.html b/templates/comments/_comment_list.html index 64947e3..14dc428 100644 --- a/templates/comments/_comment_list.html +++ b/templates/comments/_comment_list.html @@ -1,4 +1,4 @@ -
{% for comment in approved_comments %} {% include "comments/_comment.html" with comment=comment page=page %} diff --git a/templates/comments/_reply.html b/templates/comments/_reply.html index 4cf4920..8799cb6 100644 --- a/templates/comments/_reply.html +++ b/templates/comments/_reply.html @@ -1,10 +1,14 @@ -
-
-
-
-
{{ comment.author_name }}
-
{{ comment.created_at|date:"M j, Y" }}
+
+
+
+
+
+ {{ reply.author_name }} + +
+
+ {{ reply.body|linebreaks }} +
-

{{ comment.body }}

diff --git a/templates/comments/_reply_form.html b/templates/comments/_reply_form.html index 9294503..f11a2fa 100644 --- a/templates/comments/_reply_form.html +++ b/templates/comments/_reply_form.html @@ -1,30 +1,46 @@ {% load static %} -
+
+

Reply to {{ comment.author_name }}

+ {% if reply_success_message %} -
{{ reply_success_message }}
- {% endif %} - {% if reply_form_errors %} -
- {% for field, errors in reply_form_errors.items %}{% for error in errors %}

{{ error }}

{% endfor %}{% endfor %} +
+ {{ reply_success_message }}
{% endif %} + + {% if reply_form_errors %} +
+
Errors:
+
    + {% for field, errors in reply_form_errors.items %} + {% for error in errors %}
  • {{ error }}
  • {% endfor %} + {% endfor %} +
+
+ {% endif %} +
+ hx-post="{% url 'comment_post' %}" hx-target="#reply-form-container-{{ comment.id }}" hx-swap="outerHTML" + class="space-y-4"> {% csrf_token %} -
- - +
+ +
- + + {% if turnstile_site_key %} -
+
{% endif %} - + +
+ +