diff --git a/fet2020/posts/models.py b/fet2020/posts/models.py index 0940ee9e..f0377e5f 100644 --- a/fet2020/posts/models.py +++ b/fet2020/posts/models.py @@ -148,14 +148,13 @@ class Post(models.Model): self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title) - if self.has_agenda: # and (self.agenda_key == "" or self.agenda_key is None): + if self.has_agenda : self.agenda_key = ep.createPadifNotExists(self.slug + "agenda") - print("AgendaKey: %s" % self.agenda_key) + - - if self.has_protocol and (self.agenda_key == "" or self.agenda_key is None): - self.protocol_key = ep.createPadifNotExists(self.slug+"-protocol") - print("should initialize protocol document") + if self.has_protocol: + self.protocol_key = ep.createPadifNotExists(self.slug+"protocol") + super().save(*args, **kwargs) diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index db6a3c25..a57dc68e 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -75,7 +75,8 @@ def show(request, id=None): "author_image": author_image, "next": get_next_dict(p), "related_posts": p.tags.similar_objects(), - "ep_link": get_pad_link(p.agenda_key), + "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 5316be51..e8079237 100644 --- a/fet2020/templates/posts/show.html +++ b/fet2020/templates/posts/show.html @@ -34,29 +34,36 @@
+
+

{{post.title | tags_to_url }}

{{post.subtitle | tags_to_url }}
Nächster Artikel
+
+
{% include 'posts/partials/_date_box.html' %} -{{post.event_start}} -{{post.event_end}} + {% if post.has_agenda %} -EP +Agenda
{% endif %} - +{% if post.has_protocol %} +Protocol +{% endif %} +
+
-- Bearbeiten - -
-{{post.body | safe | add_internal_links | tags_to_url}}
{% for tag in post.get_tagnames %} {{tag |tags_to_url}} {% endfor %} +
+{{post.body | safe | add_internal_links | tags_to_url}} +