diff --git a/fet2020/posts/models.py b/fet2020/posts/models.py index f0377e5f..1fe7c87e 100644 --- a/fet2020/posts/models.py +++ b/fet2020/posts/models.py @@ -148,14 +148,16 @@ class Post(models.Model): self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title) - if self.has_agenda : + if self.has_agenda: # and (self.agenda_key == "" or self.agenda_key is None): self.agenda_key = ep.createPadifNotExists(self.slug + "agenda") + if self.has_protocol: self.protocol_key = ep.createPadifNotExists(self.slug+"protocol") + super().save(*args, **kwargs) self.tags.set( @@ -257,7 +259,7 @@ class FetMeeting(Event): if not self.slug: self.slug = slugify(self.event_start.date()) + "-" + slugify(self.title) self.body = "TODO: Agenda + Protokoll Link" - + # TODO # self.image diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index a57dc68e..494bc4bf 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -70,6 +70,8 @@ def show(request, id=None): if post_author: author_image = post_author.image['avatar'].url + ep_link = (get_pad_link(p.agenda_key), get_pad_link(p.protocol_key)) + context = { "post": p, "author_image": author_image, @@ -77,6 +79,7 @@ def show(request, id=None): "related_posts": p.tags.similar_objects(), "ep_agenda_link": get_pad_link(p.agenda_key), "ep_protocol_link": get_pad_link(p.protocol_key), + } response = render(request, 'posts/show.html', context) diff --git a/fet2020/templates/posts/show.html b/fet2020/templates/posts/show.html index e8079237..b6c5be76 100644 --- a/fet2020/templates/posts/show.html +++ b/fet2020/templates/posts/show.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% load post_helpers %} -{% load thumbnail %}{% load admin_urls %} +{% load admin_urls %} {% block content %}
@@ -44,7 +44,6 @@
{% include 'posts/partials/_date_box.html' %} - {% if post.has_agenda %} Agenda
{% endif %} @@ -54,9 +53,28 @@ {% endif %}
--- + Bearbeiten +Start: {{post.event_start}}
+Ende: {{post.event_end}}
+ +{% if post.has_agenda %} +Agenda +{% endif %} + +{% if post.has_protocol %} +Protokoll +{% endif %} + +{% if request.user.is_authenticated %} +
------
+Bearbeiten +{% endif %} + +
+{{post.body | safe | add_internal_links | tags_to_url}} +
{% for tag in post.get_tagnames %} {{tag |tags_to_url}}