merge
This commit is contained in:
@@ -148,14 +148,16 @@ class Post(models.Model):
|
|||||||
self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title)
|
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")
|
self.agenda_key = ep.createPadifNotExists(self.slug + "agenda")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if self.has_protocol:
|
if self.has_protocol:
|
||||||
self.protocol_key = ep.createPadifNotExists(self.slug+"protocol")
|
self.protocol_key = ep.createPadifNotExists(self.slug+"protocol")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
self.tags.set(
|
self.tags.set(
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ def show(request, id=None):
|
|||||||
if post_author:
|
if post_author:
|
||||||
author_image = post_author.image['avatar'].url
|
author_image = post_author.image['avatar'].url
|
||||||
|
|
||||||
|
ep_link = (get_pad_link(p.agenda_key), get_pad_link(p.protocol_key))
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"post": p,
|
"post": p,
|
||||||
"author_image": author_image,
|
"author_image": author_image,
|
||||||
@@ -77,6 +79,7 @@ def show(request, id=None):
|
|||||||
"related_posts": p.tags.similar_objects(),
|
"related_posts": p.tags.similar_objects(),
|
||||||
"ep_agenda_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),
|
"ep_protocol_link": get_pad_link(p.protocol_key),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
response = render(request, 'posts/show.html', context)
|
response = render(request, 'posts/show.html', context)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% load post_helpers %}
|
{% load post_helpers %}
|
||||||
{% load thumbnail %}{% load admin_urls %}
|
{% load admin_urls %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="large-article-header" style="background-image:url('{{post.imageurl}}')">
|
<div class="large-article-header" style="background-image:url('{{post.imageurl}}')">
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
<div class="cell medium-4">
|
<div class="cell medium-4">
|
||||||
{% include 'posts/partials/_date_box.html' %}
|
{% include 'posts/partials/_date_box.html' %}
|
||||||
|
|
||||||
|
|
||||||
{% if post.has_agenda %}
|
{% if post.has_agenda %}
|
||||||
<a href="{{ep_agenda_link}}">Agenda</a><br>
|
<a href="{{ep_agenda_link}}">Agenda</a><br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -54,9 +53,28 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
--
|
|
||||||
<a href="{% url "admin:posts_news_change" post.id %}">Bearbeiten</a>
|
<a href="{% url "admin:posts_news_change" post.id %}">Bearbeiten</a>
|
||||||
|
|
||||||
|
Start: {{post.event_start}}<br>
|
||||||
|
Ende: {{post.event_end}}<br>
|
||||||
|
|
||||||
|
{% if post.has_agenda %}
|
||||||
|
<a href="{{ep_link.0}}">Agenda</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if post.has_protocol %}
|
||||||
|
<a href="{{ep_link.1}}">Protokoll</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<br>------<br>
|
||||||
|
<a href="{% url "admin:posts_news_change" post.id %}">Bearbeiten</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
{{post.body | safe | add_internal_links | tags_to_url}}
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
{% for tag in post.get_tagnames %}
|
{% for tag in post.get_tagnames %}
|
||||||
{{tag |tags_to_url}}
|
{{tag |tags_to_url}}
|
||||||
|
|||||||
Reference in New Issue
Block a user