This commit is contained in:
bkfox
2019-08-07 01:45:27 +02:00
parent 324cf2ef0f
commit 248b77fca4
52 changed files with 794 additions and 384 deletions

View File

@ -5,10 +5,11 @@ Context:
{% endcomment %}
<html>
<head>
<meta charset="utf-8">
<meta name="application-name" content="aircox">
<meta name="description" content="{{ site.description }}">
<meta name="keywords" content="{{ site.tags }}">
<meta charset="utf-8" />
<meta name="application-name" content="aircox" />
<meta name="description" content="{{ site.description }}" />
<meta name="keywords" content="{{ site.tags }}" />
<meta name="generator" content="Aircox" />
<link rel="icon" href="{% thumbnail site.favicon 32x32 crop %}" />
{% block assets %}
@ -18,7 +19,7 @@ Context:
{% endblock %}
<title>
{% block head_title %}{{ site.title }}{% endblock %}
{% block head_title %}{{ station.name }}{% endblock %}
</title>
{% block head_extra %}{% endblock %}
@ -52,12 +53,14 @@ Context:
{% block header %}
<h1 class="title is-1">{% block title %}{% endblock %}</h1>
{% if parent %}
<h4 class="subtitle is-size-3">
<a href="{{ parent.get_absolute_url }}">
<h4 class="subtitle is-size-3 columns">
{% block subtitle %}
{% if parent %}
<a href="{{ parent.get_absolute_url }}" class="column">
&#10092; {{ parent.title }}</a></li>
{% endif %}
{% endblock %}
</h4>
{% endif %}
{% endblock %}
</header>

View File

@ -1,59 +0,0 @@
{% load i18n easy_thumbnails_tags aircox %}
{% comment %}
Context variables:
- object: the actual diffusion
- page: current parent page in which item is rendered
- hide_schedule: if True, do not display start time
- hide_headline: if True, do not display headline
{% endcomment %}
{% with object.episode as episode %}
{% with episode.program as program %}
<article class="media">
<div class="media-left">
<img src="{% thumbnail episode.cover 128x128 crop=scale %}"
class="small-cover">
</div>
<div class="media-content">
<h5 class="subtitle is-size-5">
{% if episode.is_published %}
<a href="{{ episode.get_absolute_url }}">{{ episode.title }}</a>
{% endif %}
</h5>
<div class="">
{% if not page or program != page %}
{% if program.is_published %}
<a href="{{ program.get_absolute_url }}" class="has-text-grey-dark">
{{ program.title }}</a>
{% else %}{{ program.title }}
{% endif %}
{% if not hide_schedule %} &mdash; {% endif %}
{% endif %}
{% if not hide_schedule %}
<time datetime="{{ object.start|date:"c" }}" title="{{ object.start }}"
class="has-text-weight-light is-size-6">
{{ object.start|date:"d M, H:i" }}
</time>
{% endif %}
{% if object.initial %}
{% with object.initial.date as date %}
<span class="tag is-info" title="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
{% trans "rerun" %}
</span>
{% endwith %}
{% endif %}
</span>
</div>
{% if not hide_headline %}
<div class="content">
{{ episode.headline }}
</div>
{% endif %}
</div>
</article>
{% endwith %}
{% endwith %}

View File

@ -1,51 +0,0 @@
{% extends "aircox/page.html" %}
{% load i18n aircox %}
{% block title %}
{% if program %}
{% with program.name as program %}
{% blocktrans %}Diffusions of {{ program }}{% endblocktrans %}
{% endwith %}
{% else %}
{% trans "All diffusions" %}
{% endif %}
{% endblock %}
{% block content %}
<section>
{% for object in object_list %}
{% include "aircox/diffusion_item.html" %}
{% endfor %}
</section>
{% if is_paginated %}
<nav class="pagination is-centered" role="pagination" aria-label="{% trans "pagination" %}">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}" class="pagination-previous">
{% else %}
<a class="pagination-previous" disabled>
{% endif %}
{% trans "Previous" %}</a>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}" class="pagination-next">
{% else %}
<a class="pagination-next" disabled>
{% endif %}
{% trans "Next" %}</a>
<ul class="pagination-list">
{% for i in paginator.page_range %}
<li>
<a class="pagination-link {% if page_obj.number == i %}is-current{% endif %}"
href="?page={{ i }}">{{ i }}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
</section>
{% endblock %}

View File

@ -34,15 +34,17 @@
{% for day, diffusions in by_date.items %}
<noscript><h4 class="subtitle is-4">{{ day|date:"l d F Y" }}</h4></noscript>
<div id="{{timetable_id}}-{{ day|date:"Y-m-d" }}" v-if="value == '{{ day }}'">
{% for object in diffusions %}
{% for diffusion in diffusions %}
<div class="columns">
<div class="column is-one-fifth has-text-right">
<time datetime="{{ object.start|date:"c" }}">
{{ object.start|date:"H:i" }} - {{ object.end|date:"H:i" }}
<time datetime="{{ diffusion.start|date:"c" }}">
{{ diffusion.start|date:"H:i" }} - {{ diffusion.end|date:"H:i" }}
</time>
</div>
<div class="column">
{% include "aircox/diffusion_item.html" %}
{% with diffusion.episode as object %}
{% include "aircox/episode_item.html" %}
{% endwith %}
</div>
</div>
{% endfor %}

View File

@ -1,6 +1,33 @@
{% extends "aircox/program_base.html" %}
{% load i18n %}
{% block header %}
{{ block.super }}
<section class="is-size-5 has-text-weight-bold">
{% for diffusion in object.diffusion_set.all %}
{% with diffusion.start as start %}
{% with diffusion.end as end %}
<time datetime="{{ start }}">{{ start|date:"D. d F Y, H:i" }}</time>
&mdash;
<time datetime="{{ end }}">{{ end|date:"H:i" }}</time>
{% endwith %}
{% endwith %}
<small>
{% if diffusion.initial %}
{% with diffusion.initial.date as date %}
<span title="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
({% trans "rerun" %})
</span>
{% endwith %}
{% endif %}
</small>
<br>
{% endfor %}
</section>
{% endblock %}
{% block main %}
{{ block.super }}

View File

@ -39,7 +39,11 @@
{{ object.start|date:"H:i" }} - {{ object.end|date:"H:i" }}
</time>
</td>
<td>{% include "aircox/diffusion_item.html" %}</td>
{% with object as diffusion %}
{% with diffusion.episode as object %}
<td>{% include "aircox/episode_item.html" %}</td>
{% endwith %}
{% endwith %}
{% else %}
<td>
<time datetime="{{ object.date }}" title="{{ object.date }}">

View File

@ -7,10 +7,17 @@ Context:
- page: page
{% endcomment %}
{% block subtitle %}
{{ block.super }}
{% if page.category %}
<span class="column has-text-right">{{ page.category.title }}</span>
{% endif %}
{% endblock %}
{% block head_title %}
{% block title %}{{ title }}{% endblock %}
{% if title %} &mdash; {% endif %}
{{ site.title }}
{% if title %} &dash; {% endif %}
{{ station.name }}
{% endblock %}

View File

@ -1,6 +1,6 @@
<div class="podcast">
{% if object.embed %}
{{ object.embed }}
{{ object.embed|safe }}
{% else %}
<audio src="{{ object.url }}" controls>
{% endif %}

View File

@ -4,22 +4,22 @@
{% block side_nav %}
{{ block.super }}
{% if diffusions %}
{% if episodes %}
<section>
<h4 class="subtitle is-size-4">{% trans "Last shows" %}</h4>
{% for object in diffusions %}
{% include "aircox/diffusion_item.html" %}
{% for object in episodes %}
{% include "aircox/episode_item.html" %}
{% endfor %}
<br>
<nav class="pagination is-centered">
<ul class="pagination-list">
<li>
<a href="{% url "diffusion-list" program_slug=page.slug %}"
<a href="{% url "diffusion-list" program_slug=program.slug %}"
class="pagination-link"
aria-label="{% trans "Show all diffusions" %}">
{% trans "All diffusions" %}
{% trans "All shows" %}
</a>
</li>
</ul>

View File

@ -1,25 +1,24 @@
{% load i18n %}
<section class="is-size-5">
<section class="is-size-5 has-text-weight-bold">
{% for schedule in program.schedule_set.all %}
<p>
{{ schedule.get_frequency_verbose }}
{% 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>
{{ schedule.get_frequency_verbose }}
{% 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="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
({% trans "rerun" %})
</span>
{% endwith %}
{% endwith %}
<small>
{% if schedule.initial %}
{% with schedule.initial.date as date %}
<span title="{% blocktrans %}Rerun of {{ date }}{% endblocktrans %}">
({% trans "rerun" %})
</span>
{% endwith %}
{% endif %}
</small>
</p>
{% endif %}
</small>
<br>
{% endfor %}
</section>