diff --git a/news/models.py b/news/models.py index 9020bb0..d939ba1 100644 --- a/news/models.py +++ b/news/models.py @@ -43,6 +43,11 @@ class Post(models.Model): tag_names = map(lambda t: t.name, self.tag_set.all()) return ", ".join(tag_names) + def html_title(self): + if self.title: + return title + return 'Poker Rumble - Amazing content' + class Comment(models.Model): author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True) post = models.ForeignKey(Post, on_delete=models.CASCADE) diff --git a/news/templates/news/index.html b/news/templates/news/index.html index 4a88248..c2dd151 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -2,22 +2,20 @@ {% load static %} -{% block title %}Poker Rumble - {% endblock %} +{% block title %}Poker Rumble - Your source of great poker content{% endblock %} {% block content %} {% if latest_post_list %} - {% for post in latest_post_list %} - - + {% for post in latest_post_list %} +
{{ post.date }} - {{ post.author.username }}
- {% if post.style == 0 %}
@@ -94,6 +92,18 @@ +
+ + +
+ {% for comment in post.top_comments %} + {{ comment.body }} - {{ comment.author.username }}
+ {% endfor %} +
+
+ {% endif %}