Make season description optional

This commit is contained in:
Evert Prants 2017-12-28 17:24:27 +02:00
parent 971730f1cb
commit 2bcf645461
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
5 changed files with 33 additions and 7 deletions

View File

@ -225,7 +225,8 @@ class Season(models.Model):
help_text='The number of this season, starting at 1; For example, the first season to be aired would be number 1, and the second would be number 2' help_text='The number of this season, starting at 1; For example, the first season to be aired would be number 1, and the second would be number 2'
) )
description = models.TextField( description = models.TextField(
help_text='A description of this season\'s happenings' help_text='A description of this season\'s happenings',
blank=True
) )
artwork = models.ImageField( artwork = models.ImageField(
storage=show_static_storage, storage=show_static_storage,

View File

@ -34,7 +34,11 @@
<h3>Season {{ episode.season.number }}</h3> <h3>Season {{ episode.season.number }}</h3>
{% endif %} {% endif %}
<p class="description"> <p class="description">
{% if episode.season.description %}
{{ episode.season.description }} {{ episode.season.description }}
{% else %}
{{ show.description }}
{% endif %}
</p> </p>
</div> </div>
</div> </div>

View File

@ -7,12 +7,25 @@
<div class="banner" style="background-image: url(/media/uploaded_resources/{{show.banner}});"></div> <div class="banner" style="background-image: url(/media/uploaded_resources/{{show.banner}});"></div>
<div class="banner-cover"> <div class="banner-cover">
<div class="artwork"> <div class="artwork">
{% if episode.season.artwork %}
<img src="/media/uploaded_resources/{{season.artwork}}">
{% else %}
<img src="/media/uploaded_resources/{{show.artwork}}"> <img src="/media/uploaded_resources/{{show.artwork}}">
{% endif %}
</div> </div>
<div class="details"> <div class="details season">
<h1>{{show.name}}</h1> <h1>{{show.name}}</h1>
{% if season.name %}
<h3>{{ season.name }}</h3>
{% else %}
<h3>Season {{ season.number }}</h3>
{% endif %}
<p class="description"> <p class="description">
{{show.description}} {% if season.description %}
{{ season.description }}
{% else %}
{{ show.description }}
{% endif %}
</p> </p>
</div> </div>
</div> </div>

View File

@ -21,7 +21,11 @@
<h3>Season {{ episode.season.number }}</h3> <h3>Season {{ episode.season.number }}</h3>
{% endif %} {% endif %}
<p class="description"> <p class="description">
{% if episode.season.description %}
{{ episode.season.description }} {{ episode.season.description }}
{% else %}
{{ show.description }}
{% endif %}
</p> </p>
</div> </div>
</div> </div>

View File

@ -21,7 +21,11 @@
<h3>Season {{ episode.season.number }}</h3> <h3>Season {{ episode.season.number }}</h3>
{% endif %} {% endif %}
<p class="description"> <p class="description">
{% if episode.season.description %}
{{ episode.season.description }} {{ episode.season.description }}
{% else %}
{{ show.description }}
{% endif %}
</p> </p>
</div> </div>
</div> </div>