From c90253c1ad4835e43bc28781c9af9ee1eed98e4a Mon Sep 17 00:00:00 2001 From: lxf Date: Fri, 22 Mar 2019 20:33:57 +0000 Subject: fixed comment preview template and latest redirect --- app/jrnl/views.py | 2 +- design/templates/comments/preview.html | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/app/jrnl/views.py b/app/jrnl/views.py index 7ea3e41..ed5018b 100644 --- a/app/jrnl/views.py +++ b/app/jrnl/views.py @@ -139,7 +139,7 @@ class JrnlLatestView(EntryDetailView): template_name = "details/entry_latest.html" def get_object(self, queryset=None): - obj = self.model.objects.latest() + obj = self.model.objects.filter(status=1).latest() self.location = obj.location return obj diff --git a/design/templates/comments/preview.html b/design/templates/comments/preview.html index 8129658..164b724 100644 --- a/design/templates/comments/preview.html +++ b/design/templates/comments/preview.html @@ -11,34 +11,37 @@ class="detail"{%endblock%}

{% trans "Preview your comment" %}

+ {% load comments %} -
{% csrf_token %} +
+
+ {% csrf_token %} {% if next %}
{% endif %} {% if form.errors %}

{% if form.errors|length == 1 %}{% trans "Please correct the error below" %}{% else %}{% trans "Please correct the errors below" %}{% endif %}

{% else %}
{{ comment|linebreaks }}

-

{% trans "Or make changes" %}:

+

{% trans "Or make changes" %}:

{% endif %} {% for field in form %} {% if field.is_hidden %} -
{{ field }}
+ {{ field }} {% else %} - {% if field.errors %}{{ field.errors }}{% endif %} - + {% endif %} {% endfor %} -

- - -

+
+ + +
+
+
{% endblock %} -- cgit v1.2.3