if subtitle is None, it will be replacedwith a no-break space.

This commit is contained in:
2020-09-24 09:02:59 +00:00
parent 864a72e4dc
commit 77abe560c6
3 changed files with 64 additions and 71 deletions

View File

@@ -18,7 +18,7 @@
<div class="article-title"> <div class="article-title">
<h1>{{ post.title|safe }}</h1> <h1>{{ post.title|safe }}</h1>
<p>{{post.subtitle | safe}}</p> <p>{{ post.subtitle|default_if_none:"&nbsp;"|safe }}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -27,7 +27,6 @@
</div> </div>
<div class="medium-4 responsive-side-box cell"> <div class="medium-4 responsive-side-box cell">
<a href="{% url 'posts.index' %}"><h1>Neuigkeiten</h1></a> <a href="{% url 'posts.index' %}"><h1>Neuigkeiten</h1></a>
<div class="article-row-section"> <div class="article-row-section">
{% with post=featured_post %} {% with post=featured_post %}
@@ -37,7 +36,6 @@
{% include 'posts/partials/_meeting_row.html' %} {% include 'posts/partials/_meeting_row.html' %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
@@ -46,7 +44,6 @@
{{ tags_list|tags_to_url }} {{ tags_list|tags_to_url }}
</div> </div>
<div class="grid-x grid-x-padding"> <div class="grid-x grid-x-padding">
<div class="medium-8 small-12 small-order-2 medium-order-1""> <div class="medium-8 small-12 small-order-2 medium-order-1"">
{% for post in posts %} {% for post in posts %}

View File

@@ -2,7 +2,8 @@
<div class="news-hero padding-bottom-1" style="background-image:url('{{ post.imageurl }}')"> <div class="news-hero padding-bottom-1" style="background-image:url('{{ post.imageurl }}')">
<div class="news-hero-text"> <div class="news-hero-text">
<h1>{{ post.title }}</h1> <h1>{{ post.title }}</h1>
<h2>{{post.subtitle}}</h2>{{post}} <h2>{{ post.subtitle|default_if_none:"&nbsp;" }}</h2>
{{ post }}
</div> </div>
</div> </div>
</a> </a>

View File

@@ -1,4 +1,3 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% load post_helpers %} {% load post_helpers %}
{% load admin_urls %} {% load admin_urls %}
@@ -16,7 +15,7 @@
</div> </div>
<div class="article-details"> <div class="article-details">
{{post.subtitle |tags_to_url}} {{ post.subtitle|default_if_none:"&nbsp;"|tags_to_url }}
{% if post.author %} {% if post.author %}
<div class="article-author"><a href="{% url 'member' post.author %}"> <div class="article-author"><a href="{% url 'member' post.author %}">
@@ -29,11 +28,7 @@
{{ post.author }}</a> {{ post.author }}</a>
</div> </div>
{% endif %} {% endif %}
</div>
</div> <button class="">
<span class="nav fa fa-chevron-right fa-3x"></span>
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -42,11 +37,11 @@
<div class="grid-x"> <div class="grid-x">
<div class="cell medium-8"> <div class="cell medium-8">
<h1>{{ post.title|tags_to_url }}</h1> <h1>{{ post.title|tags_to_url }}</h1>
<strong>{{post.subtitle | tags_to_url}}</strong><span class="nav fa fa-chevron-right fa-3x"></span> <strong>{{ post.subtitle|default_if_none:"&nbsp;"|tags_to_url }}</strong>
<span class="nav fa fa-chevron-right fa-3x"></span>
<br> <br>
<a href="{% url 'posts.show' next %}">Nächster Artikel</a><br> <a href="{% url 'posts.show' next %}">Nächster Artikel</a><br>
<div class="cell medium-4"> <div class="cell medium-4">
{% include 'posts/partials/_date_box.html' %} {% include 'posts/partials/_date_box.html' %}
</div> </div>
@@ -81,8 +76,8 @@
{{ post.body|safe|add_internal_links|tags_to_url }} {{ post.body|safe|add_internal_links|tags_to_url }}
<hr> <hr>
</div> </div>
</div> </div>
<div class="grid-x grid-margin-x"> <div class="grid-x grid-margin-x">
{% for post in related_posts %} {% for post in related_posts %}
<div class="medium-6 large-4 small-12 cell"> <div class="medium-6 large-4 small-12 cell">