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 %}