add protocoll link if available

This commit is contained in:
2020-09-08 11:35:18 +00:00
parent 7fe65d5bca
commit bc65cfdcbc
2 changed files with 13 additions and 7 deletions

View File

@@ -70,12 +70,14 @@ 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,
"next": get_next_dict(p), "next": get_next_dict(p),
"related_posts": p.tags.similar_objects(), "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) response = render(request, 'posts/show.html', context)

View File

@@ -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}}')">
@@ -39,17 +39,21 @@
<br> <br>
<a href="{% url 'posts.show' next %}">Nächster Artikel</a><br> <a href="{% url 'posts.show' next %}">Nächster Artikel</a><br>
{% include 'posts/partials/_date_box.html' %} {% include 'posts/partials/_date_box.html' %}
{{post.event_start}} Start: {{post.event_start}}<br>
{{post.event_end}} Ende: {{post.event_end}}<br>
{% if post.has_agenda %} {% if post.has_agenda %}
<a href="{{ep_link}}">EP</a> <a href="{{ep_link.0}}">Agenda</a>
{% endif %} {% 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> <a href="{% url "admin:posts_news_change" post.id %}">Bearbeiten</a>
{% endif %}
<hr> <hr>
{{post.body | safe | add_internal_links | tags_to_url}} {{post.body | safe | add_internal_links | tags_to_url}}