responsive menus

This commit is contained in:
bkfox
2023-11-29 15:41:15 +01:00
parent f5ce00795e
commit 8202a9324c
17 changed files with 639 additions and 336 deletions

View File

@ -6,21 +6,42 @@
{% block content-container %}
{% with schedules=program.schedule_set.all %}
{% if schedules %}
<section class="container schedules">
{% for schedule in schedules %}
<div class="schedule">
<div class="heading">
<span class="day">{{ schedule.get_frequency_display }}</span>
{% with schedule.start|date:"H:i" as start %}
{% with schedule.end|date:"H:i" as end %}
<time datetime="{{ start }}">{{ start }}</time>
&mdash;
<time datetime="{{ end }}">{{ end }}</time>
{% endwith %}
{% endwith %}
<small>
{% if schedule.initial %}
{% with schedule.initial.date as date %}
<span title="{% blocktranslate %}Rerun of {{ date }}{% endblocktranslate %}">
({% translate "Rerun" %})
</span>
{% endwith %}
{% endif %}
</small>
</div>
</div>
{% endfor %}
</section>
{% endif %}
{% endwith %}
{{ block.super }}
{% if episodes %}
<section class="container">
<h3 class="title is-3">{% translate "Last Episodes" %}</h3>
<a-carousel section-class="card-grid">
{% for object in episodes %}
{% page_widget "card" object %}
{% endfor %}
</a-carousel>
<nav class="nav-urls">
<a href="{% url "episode-list" parent_slug=program.slug %}">
{% translate "See more" %}
</a>
</nav>
{% include "./widgets/carousel.html" with objects=episodes url_name="episode-list" url_parent=object url_label=_("All episodes") %}
</section>
{% endif %}
@ -28,47 +49,8 @@
{% if articles %}
<section class="container">
<h3 class="title is-3">{% translate "Last Articles" %}</h3>
<a-carousel section-class="card-grid">
{% for object in articles %}
{% page_widget "card" object %}
{% endfor %}
</a-carousel>
<nav class="nav-urls">
<a href="{% url "article-list" parent_slug=program.slug %}"
aria-label="{% translate "Show all program's articles" %}">
{% translate "See more" %}
</a>
</nav>
{% include "./widgets/carousel.html" with objects=articles url_name="article-list" url_parent=object url_label=_("All articles") %}
</section>
{% endif %}
{% endblock %}
{% block sidebar %}
<section>
<h4 class="title is-4">{% translate "Diffusions" %}</h4>
{% for schedule in program.schedule_set.all %}
{{ schedule.get_frequency_display }}
{% with schedule.start|date:"H:i" as start %}
{% with schedule.end|date:"H:i" as end %}
<time datetime="{{ start }}">{{ start }}</time>
&mdash;
<time datetime="{{ end }}">{{ end }}</time>
{% endwith %}
{% endwith %}
<small>
{% if schedule.initial %}
{% with schedule.initial.date as date %}
<span title="{% blocktranslate %}Rerun of {{ date }}{% endblocktranslate %}">
({% translate "Rerun" %})
</span>
{% endwith %}
{% endif %}
</small>
<br>
{% endfor %}
</section>
{{ block.super }}
{% endblock %}