fix bugs + default page cover
This commit is contained in:
parent
1003ad315f
commit
1a3e8d7771
|
@ -66,6 +66,11 @@ class Station(models.Model):
|
||||||
help_text=_("Audio streams urls used by station's player. One url "
|
help_text=_("Audio streams urls used by station's player. One url "
|
||||||
"a line.")
|
"a line.")
|
||||||
)
|
)
|
||||||
|
default_cover = FilerImageField(
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
|
verbose_name=_('Default pages cover'), null=True, blank=True,
|
||||||
|
related_name='+',
|
||||||
|
)
|
||||||
|
|
||||||
objects = StationQuerySet.as_manager()
|
objects = StationQuerySet.as_manager()
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% if not parent %}{{ view.model|verbose_name:True|title }}
|
{% if not parent %}{{ view.model|verbose_name:True|title }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with parent.title as title %}
|
{% with parent.title as title %}
|
||||||
{% with model|default:"Publications"|verbose_name:true|capfirst as model %}
|
{% with model|default:"Publications"|verbose_name:True|capfirst as model %}
|
||||||
{% comment %}Translators: title when pages are filtered for a specific parent page, e.g.: Articles of My Incredible Show{% endcomment %}
|
{% comment %}Translators: title when pages are filtered for a specific parent page, e.g.: Articles of My Incredible Show{% endcomment %}
|
||||||
{% blocktrans %}{{ model }} of {{ title }}{% endblocktrans %}
|
{% blocktrans %}{{ model }} of {{ title }}{% endblocktrans %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
|
@ -14,7 +14,7 @@ Context variables:
|
||||||
<article class="card {% if is_primary %}is-primary{% endif %}">
|
<article class="card {% if is_primary %}is-primary{% endif %}">
|
||||||
<header class="card-image">
|
<header class="card-image">
|
||||||
<figure class="image is-4by3">
|
<figure class="image is-4by3">
|
||||||
<img src="{% thumbnail object.cover 480x480 %}">
|
<img src="{% thumbnail object.cover|default:station.default_cover 480x480 %}">
|
||||||
</figure>
|
</figure>
|
||||||
</header>
|
</header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
@ -29,7 +29,7 @@ Context variables:
|
||||||
<article class="media item {% if is_primary %}is-primary{% endif %}">
|
<article class="media item {% if is_primary %}is-primary{% endif %}">
|
||||||
{% if has_cover|default_if_none:True %}
|
{% if has_cover|default_if_none:True %}
|
||||||
<div class="media-left">
|
<div class="media-left">
|
||||||
<img src="{% thumbnail object.cover 128x128 crop=scale %}"
|
<img src="{% thumbnail object.cover|default:station.default_cover 128x128 crop=scale %}"
|
||||||
class="small-cover">
|
class="small-cover">
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user