From f60444c231488bdc7cc8228b829272b8795399c0 Mon Sep 17 00:00:00 2001 From: Laurent Morvillier Date: Tue, 8 Oct 2019 16:26:31 +0200 Subject: [PATCH] various fixes and improvements --- news/models.py | 2 +- news/static/news/css/app.css | 8 ++-- news/templates/base.html | 2 +- news/templates/news/post.html | 27 ++++++++--- .../news/user/password_reset_confirm.html | 45 +++++++++++++------ .../news/user/password_reset_html_email.html | 3 +- .../news/user/password_reset_subject.txt | 1 + news/urls.py | 7 +-- pokercc/settings.py | 9 +++- 9 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 news/templates/news/user/password_reset_subject.txt diff --git a/news/models.py b/news/models.py index df6ab82..52e4525 100644 --- a/news/models.py +++ b/news/models.py @@ -30,7 +30,7 @@ class Post(models.Model): return string def top_comments(self): - return self.comment_set.order_by('-voters').all()[:1] + return self.comment_set.filter(Q(parent_comment=None)).order_by('-voters').all()[:1] def flat_comments(self, user): flat = [] diff --git a/news/static/news/css/app.css b/news/static/news/css/app.css index 78986aa..b0655d2 100644 --- a/news/static/news/css/app.css +++ b/news/static/news/css/app.css @@ -180,14 +180,14 @@ a h1 { .imgcontainer { position: relative; color: white; - border-bottom: 10px solid #111; - border-top: 10px solid #111; + /* border-bottom: 0px solid #111; */ + border-top: 20px solid #111; } @media print, screen and (min-width: 40em) { .imgcontainer { width: 600px; - border-bottom: 10px solid #111; - border-top: 10px solid #111; + /* border-bottom: 10px solid #111; */ + border-top: 20px solid #111; } } diff --git a/news/templates/base.html b/news/templates/base.html index a761eb5..49a5f9f 100644 --- a/news/templates/base.html +++ b/news/templates/base.html @@ -61,7 +61,7 @@ diff --git a/news/templates/news/post.html b/news/templates/news/post.html index ea06802..4739df5 100644 --- a/news/templates/news/post.html +++ b/news/templates/news/post.html @@ -36,14 +36,20 @@ {% endif %}
-
- {% csrf_token %} -

Add comment

+ {% if user.is_authenticated %} + + {% csrf_token %} +

Add comment

+

+ +

+ +
+ {% else %}

- + Please login to comment the post

- - + {% endif %}