From 7fe65d5bca4452a984513df8a7e4c4d081bb2ed8 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 8 Sep 2020 11:34:37 +0000 Subject: [PATCH 1/2] make master pep8-ready again --- fet2020/posts/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fet2020/posts/models.py b/fet2020/posts/models.py index 0940ee9e..bfb477bf 100644 --- a/fet2020/posts/models.py +++ b/fet2020/posts/models.py @@ -147,14 +147,12 @@ class Post(models.Model): if (self.id is None) and (not self.slug): self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title) - if self.has_agenda: # and (self.agenda_key == "" or self.agenda_key is None): 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") + self.protocol_key = ep.createPadifNotExists(self.slug + "-protocol") print("should initialize protocol document") super().save(*args, **kwargs) @@ -258,7 +256,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 From bc65cfdcbcda9f9a2385f1afa20de71824b5d490 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 8 Sep 2020 11:35:18 +0000 Subject: [PATCH 2/2] add protocoll link if available --- fet2020/posts/views.py | 4 +++- fet2020/templates/posts/show.html | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index db6a3c25..1371935e 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -70,12 +70,14 @@ 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, "next": get_next_dict(p), "related_posts": p.tags.similar_objects(), - "ep_link": get_pad_link(p.agenda_key), + "ep_link": ep_link, } response = render(request, 'posts/show.html', context) diff --git a/fet2020/templates/posts/show.html b/fet2020/templates/posts/show.html index 5316be51..d6f3c297 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 %}
@@ -39,17 +39,21 @@
Nächster Artikel
{% include 'posts/partials/_date_box.html' %} -{{post.event_start}} -{{post.event_end}} +Start: {{post.event_start}}
+Ende: {{post.event_end}}
{% if post.has_agenda %} -EP +Agenda {% endif %} +{% if post.has_protocol %} +Protokoll +{% endif %} --- +{% if request.user.is_authenticated %} +
------
Bearbeiten - +{% endif %}
{{post.body | safe | add_internal_links | tags_to_url}}