update post view, limit related_posts to max 6

This commit is contained in:
2020-10-28 00:22:42 +00:00
parent 95feb2b961
commit 6a0dda89cd
3 changed files with 23 additions and 20 deletions

View File

@@ -91,7 +91,7 @@ def show(request, id=None):
"post": p,
"author_image": author_image,
"next": get_next_dict(p),
"related_posts": p.tags.similar_objects(),
"related_posts": p.tags.similar_objects()[:6],
"ep_agenda_link": ep_agenda_link,
"ep_protocol_link": ep_protocol_link,
}

View File

@@ -76,14 +76,14 @@ footer {
<div class="cell medium-6 large-9">
<div class="grid-y" style="height: 150px;">
<div class="cell small-6 medium-6 large-6 padding-left-1">
<div class="cell small-6 medium-6 large-6">
<a href="{% url 'posts.show' 'impressum'%}" style="color: white">Impressum</a>
</div>
<div class="cell small-6 medium-6 large-6">
<a class="button" href="https://www.facebook.com/FachschaftET" style="background-color: Transparent;"><i class="fab fa-facebook-square" style="font-size:30px"></i></a>
<a class="button" href="https://www.instagram.com/fet_tuwien/" style="background-color: Transparent;"><i class="fab fa-instagram-square" style="font-size:30px"></i></a>
<a class="button" href="https://t.me/FETInfo" style="background-color: Transparent;"><i class="fa fa-telegram" style="font-size:30px"></i></a>
<a href="https://www.facebook.com/FachschaftET"><i class="fab fa-facebook-square" style="font-size:30px; color: white;"></i></a>
<a href="https://www.instagram.com/fet_tuwien/"><i class="fab fa-instagram-square" style="font-size:30px; color: white;"></i></a>
<a href="https://t.me/FETInfo"><i class="fa fa-telegram" style="font-size:30px; color: white;"></i></a>
</div>
</div>

View File

@@ -34,12 +34,8 @@
</div>
<div class="grid-container">
<h1>{{ post.title|tags_to_url }}</h1>
<strong>{{ post.subtitle|default_if_none:"&nbsp;"|tags_to_url }}</strong>
<br>
<div class="grid-x grid-padding-x">
<div class="grid-x grid-padding-x padding-top-1">
<div class="cell medium-8">
<hr>
{% for tag in post.get_tagnames %}
{{ tag|tags_to_url }}
{% endfor %}
@@ -61,15 +57,22 @@
{% endif %}
{% if post.has_protocol %}
<a href="{{ ep_protocol_link }}">Protokoll</a>
<a href="{{ ep_protocol_link }}">Protokoll</a><br>
{% endif %}
{% endif %}
{% if post.event_start %}
Start: {{ post.event_start }}<br>
{% endif %}
{% if post.event_end %}
Ende: {{ post.event_end }}<br>
<a href="{% url 'posts.show' next %}">Nächster Artikel </a><span class="nav fa fa-chevron-right fa-1x"></span><br>
{% endif %}
<a href="{% url 'posts.show' next %}">Nächster Artikel <span class="nav fa fa-chevron-right fa-1x"></span></a><br>
{% if post.event_start %}
{% include 'posts/partials/_date_box.html' %}
{% endif %}
</div>
</div>