calendar is now only future events; posts include members and images

This commit is contained in:
2020-08-27 20:01:24 +00:00
parent 7faddf6468
commit 37dff3b310
8 changed files with 21 additions and 12 deletions

View File

@@ -41,11 +41,20 @@ def show(request, id=None):
elif id != "" and id is not None:
p = Post.objects.get(slug=(id))
from members.models import Member
from easy_thumbnails.files import get_thumbnailer
#post_author = p.author
post_author = Member.all_members.filter(nickname=p.author)
post_author_thumb_url = get_thumbnailer(post_author[0].image)['thumb'].url
context = {
"post": p,
"next": get_next_dict().get(p.slug, None),
"related_posts": p.tags.similar_objects(),
"ep_link": get_pad_link(p.slug + "-agenda")
"ep_link": get_pad_link(p.slug + "-agenda"),
"author_image": post_author_thumb_url
}
response = render(request, 'posts/show.html', context)
response.set_cookie("HelloWorld", "TestWert", domain="https://etherpad2.2020.fet.at")