aircox-radiocampus/aircox/templates/aircox/widgets/basepage_item.html
2022-10-08 13:46:30 +02:00

74 lines
2.2 KiB
HTML

{% load i18n easy_thumbnails_tags aircox %}
{% comment %}
List item for a page
Context variables:
- object: the object to render
- render_card: render as card
- is-primary: render as primary
- has_headline (=False): if True, display headline
- has_cover (=True): hide page cover
- is_thin (=False): if True, smaller cover and display less info
{% endcomment %}
{% if render_card %}
<article class="card {% if is_primary %}is-primary{% endif %}">
<header class="card-image">
<a href="{{ object.get_absolute_url }}">
<figure class="image is-4by3">
<img src="{% thumbnail object.cover|default:station.default_cover 480x480 %}">
</figure>
</a>
</header>
<div class="card-header">
<h4 class="title">
<a href="{{ object.get_absolute_url }}">
{% block card_title %}{{ object.title }}{% endblock %}
</a>
</h4>
</div>
</article>
{% else %}
<article class="media item {% block css %}{% endblock%}">
{% if has_cover|default_if_none:True %}
<div class="media-left">
{% if is_thin %}
<img src="{% thumbnail object.cover|default:station.default_cover 64x64 crop=scale %}"
class="cover is-tiny">
{% else %}
<img src="{% thumbnail object.cover|default:station.default_cover 128x128 crop=scale %}"
class="cover is-small">
{% endif %}
</div>
{% endif %}
<div class="media-content">
<h5 class="title is-5 has-text-weight-normal">
{% block title %}
{% if object.is_published %}
<a href="{{ object.get_absolute_url }}">{{ object.title }}</a>
{% else %}
{{ object.title }}
{% endif %}
{% endblock %}
</h5>
<div class="subtitle is-6 has-text-weight-light">
{% block subtitle %}
{% if object.category %}{{ object.category.title }}{% endif %}
{% endblock %}
</div>
{% if has_headline|default_if_none:True %}
<div class="headline">
{% block headline %}{{ object.headline }}{% endblock %}
</div>
{% endif %}
</div>
{% block actions %}{% endblock %}
</article>
{% endif %}