diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index f631ce83..176018dc 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -33,7 +33,12 @@ def index(request): def tags(request, tag=""): posts = deque(Post.objects.filter(tags__name=tag)) - return render(request, 'posts/index.html', {"posts": posts, "tags_list": None}) + featured_post = Post.objects.filter(slug=tag).first() + context= { + "posts": posts, + "featured_post":featured_post, + "tags_list": None} + return render(request, 'posts/tag.html',context) def show(request, id=None): diff --git a/fet2020/templates/posts/tag.html b/fet2020/templates/posts/tag.html new file mode 100644 index 00000000..b1f036c6 --- /dev/null +++ b/fet2020/templates/posts/tag.html @@ -0,0 +1,52 @@ +{% extends 'layout.html' %} +{% load post_helpers %} +{% load thumbnail %} +{% block content %} +{% if featured_post != None %} +{% with post=featured_post %} +
+
+
+ +
+

{{post.title | tags_to_url }}

+
+
+ {{post.subtitle | tags_to_url }} + {% if post.author_member != None %} + + {% else %} + + {% endif %} + +
+
+
+
+ {% endwith %} +{% endif %} +
+ + +
+
+ {% for post in posts %} + {% include 'posts/partials/_posts_hero.html' %} + {% endfor %} + + +
+
+
+{% endblock %} \ No newline at end of file