protocol & grid post show
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,29 +34,36 @@
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="grid-container">
|
||||
<div class="grid-x">
|
||||
<div class="cell medium-8">
|
||||
<h1>{{post.title | tags_to_url }}</h1>
|
||||
<strong>{{post.subtitle | tags_to_url }}</strong><span class="nav fa fa-chevron-right fa-3x"></span>
|
||||
<br>
|
||||
<a href="{% url 'posts.show' next %}">Nächster Artikel</a><br>
|
||||
</div>
|
||||
<div class="cell medium-4">
|
||||
{% include 'posts/partials/_date_box.html' %}
|
||||
{{post.event_start}}
|
||||
{{post.event_end}}
|
||||
|
||||
|
||||
{% if post.has_agenda %}
|
||||
<a href="{{ep_link}}">EP</a>
|
||||
<a href="{{ep_agenda_link}}">Agenda</a><br>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if post.has_protocol %}
|
||||
<a href="{{ep_protocol_link}}">Protocol</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
--
|
||||
<a href="{% url "admin:posts_news_change" post.id %}">Bearbeiten</a>
|
||||
|
||||
|
||||
<hr>
|
||||
{{post.body | safe | add_internal_links | tags_to_url}}
|
||||
<hr>
|
||||
{% for tag in post.get_tagnames %}
|
||||
{{tag |tags_to_url}}
|
||||
{% endfor %}
|
||||
<hr>
|
||||
{{post.body | safe | add_internal_links | tags_to_url}}
|
||||
|
||||
<hr>
|
||||
<div class="grid-x grid-margin-x">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user