work on player

This commit is contained in:
bkfox
2020-10-22 00:30:02 +02:00
parent c10a114393
commit 2a0d0b1758
50 changed files with 19630 additions and 2193 deletions

View File

@ -79,14 +79,17 @@ Usefull context:
</h3>
<div class="columns is-size-4">
{% block header_meta %}
{% if parent %}
<a href="{{ parent.get_absolute_url }}" class="column">
&#10092; {{ parent.title }}</a></li>
{% endif %}
{% block header_nav %}
<span class="column">
{% block header_crumbs %}
{% if parent %}
<a href="{{ parent.get_absolute_url }}">
{{ parent.title }}</a></li>
{% endif %}
{% endblock %}
</span>
{% endblock %}
</div>
{% endblock %}
</header>

View File

@ -1,61 +1,66 @@
{% extends "aircox/program_base.html" %}
{% extends "aircox/page_detail.html" %}
{% comment %}List of a show's episodes for a specific{% endcomment %}
{% load i18n %}
{% block header %}{{ block.super }}
{% include "aircox/program_sidebar.html" %}
<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 %}
{% block content %}
{{ block.super }}
<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 content %}{{ block.super }}
{% if podcasts or tracks %}
<div class="columns is-desktop">
{% if tracks %}
<section class="column">
<h4 class="title is-4">{% trans "Playlist" %}</h4>
<ol>
{% for track in tracks %}
<li><span>{{ track.title }}</span>
<span class="has-text-grey-dark has-text-weight-light">
&mdash; {{ track.artist }}
{% if track.info %}(<i>{{ track.info }}</i>){% endif %}
<h5 class="title is-5">{% trans "Diffusions" %}</h5>
<ul>
{% for diffusion in object.diffusion_set.all %}
<li>
{% 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>
</li>
{% endfor %}
</ol>
{% endwith %}
{% endif %}
</small>
<br>
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% if podcasts %}
<section class="column">
<h4 class="title is-4">{% trans "Podcasts" %}</h4>
<h5 class="title is-5">{% trans "Podcasts" %}</h5>
{% for object in podcasts %}
{% include "aircox/widgets/podcast_item.html" %}
{% endfor %}
</section>
{% endif %}
</div>
{% if tracks %}
<section class="column">
<h4 class="title is-4">{% trans "Playlist" %}</h4>
<ol>
{% for track in tracks %}
<li><span>{{ track.title }}</span>
<span class="has-text-grey-dark has-text-weight-light">
&mdash; {{ track.artist }}
{% if track.info %}(<i>{{ track.info }}</i>){% endif %}
</span>
</li>
{% endfor %}
</ol>
</section>
{% endif %}
{% endblock %}

View File

@ -13,6 +13,7 @@
{% block pages_list %}
{% if page and page.content %}<hr/>{% endif %}
{% if top_diffs %}
<div class="columns">
{% with render_card=True %}
{% for object in top_diffs %}
@ -20,11 +21,13 @@
<div class="column is-relative">
<h4 class="card-super-title" title="{{ object.start }}">
{% if is_primary %}
<span class="fas fa-play"></span>
<time datetime="{{ object.start }}">
{% trans "Currently" %}
{% else %}{{ object.start|date:"H:i" }}{% endif %}
</time>
<span class="fas fa-play"></span>
<time datetime="{{ object.start }}">
{% trans "Currently" %}
</time>
{% else %}
{{ object.start|date:"H:i" }}
{% endif %}
{% if object.episode.category %}
// {{ object.episode.category.title }}
@ -36,8 +39,9 @@
{% endfor %}
{% endwith %}
</div>
<hr>
{% endif %}
<h4 class="title is-4">{% trans "Last publications" %}</h4>
{% with has_headline=True %}
{{ block.super }}

View File

@ -7,12 +7,11 @@ Context:
- page: page
{% endcomment %}
{% block header_meta %}{{ block.super }}
<span class="column has-text-right">
{% if page.category %}
{{ page.category.title }}
{% endif %}
</span>
{% block header_crumbs %}
{{ block.super }}
{% if page.category %}
/ {{ page.category.title }}
{% endif %}
{% endblock %}
{% block main %}
@ -21,7 +20,7 @@ Context:
{% block comments %}
{% if comments or comment_form %}
<hr>
<section>
<section class="mt-6">
<h4 class="title is-4">{% trans "Comments" %}</h4>
{% for comment in comments %}

View File

@ -1,11 +0,0 @@
{% extends "aircox/page_detail.html" %}
{% comment %}Base template used to display informations of a specific show{% endcomment %}
{% load i18n %}
{% block sidebar_title %}
{% with program.title as program %}
{% blocktrans %}Recently on {{ program }}{% endblocktrans %}
{% endwith %}
{% endblock %}

View File

@ -1,22 +1,46 @@
{% extends "aircox/program_base.html" %}
{% extends "aircox/page_detail.html" %}
{% comment %}Detail page of a show{% endcomment %}
{% load i18n %}
{% block header %}
{{ block.super }}
{% include "aircox/program_header.html" %}
{% include "aircox/program_sidebar.html" %}
{% block header_nav %}
{% endblock %}
{% block content %}
{{ block.super }}
<br>
{% with has_headline=False %}
<div class="columns is-desktop">
<section class="column">
<h5 class="title is-5">{% trans "Diffusions" %}</h5>
{% for schedule in program.schedule_set.all %}
{{ 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 %}
{% endif %}
</small>
<br>
{% endfor %}
</section>
{% if articles %}
<section class="column">
<h4 class="title is-4">{% trans "Articles" %}</h4>
<h4 class="title is-5">{% trans "Articles" %}</h4>
{% for object in articles %}
{% include "aircox/widgets/page_item.html" %}

View File

@ -1,29 +0,0 @@
{% comment %}
Header displaying informations of a program.
FIXME: consider moving into the "widgets" directory.
{% endcomment %}
{% load i18n %}
<section class="is-size-5 has-text-weight-bold">
{% for schedule in program.schedule_set.all %}
{{ 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 %}
{% endif %}
</small>
<br>
{% endfor %}
</section>

View File

@ -1,9 +1,8 @@
{% load i18n %}
{% load i18n aircox %}
{% comment %}
The audio player
{% endcomment %}
{% if audio_streams %}
<br>
<div class="box is-fullwidth is-fixed-bottom is-paddingless player"
@ -18,37 +17,34 @@ The audio player
{# TODO: live infos #}
</noscript>
<a-player ref="player" src="{{ audio_streams.0 }}"
live-info-url="{% url "api:live" %}" :live-info-timeout="20"
<a-player ref="player"
:live-args="{url: '{% url "api:live" %}', timeout:10, src: {{ audio_streams|json }} || []}"
button-title="{% trans "Play or pause audio" %}">
<template v-slot:sources>
{% for stream in audio_streams %}
<source src="{{ stream }}" />
{% endfor %}
</template>
<template v-slot:track="{ onAir }">
<h4 class="title is-4" aria-description="{% trans "Track currently on air" %}">
<template v-slot:content="{ current }">
<h4 v-if="current && current.type == 'track'"
class="title is-4" aria-description="{% trans "Track currently on air" %}">
<span class="has-text-info is-size-3">&#9836;</span>
<span>[[ onAir.title ]]</span>
<span>[[ current.title ]]</span>
<span class="has-text-grey-dark has-text-weight-light">
&mdash; [[ onAir.artist ]]
<i v-if="onAir.info">([[ onAir.info ]])</i>
&mdash; [[ current.artist ]]
<i v-if="current.info">([[ current.info ]])</i>
</span>
</h4>
</template>
<template v-slot:diffusion="{ onAir }">
<h4 class="title is-4" aria-description="{% trans "Diffusion currently on air" %}">
<a :href="onAir.url">[[ onAir.title ]]</a>
<div v-else-if="current && current.type == 'diffusion'">
<h4 class="title is-4" aria-description="{% trans "Diffusion currently on air" %}">
<a :href="current.url">[[ current.title ]]</a>
</h4>
<div class="">[[ current.info ]]</div>
</div>
<h4 v-else-if="current" class="title is-4">
[[ current.name ]]
</h4>
<h4 v-else class="title is-4" aria-description="{% trans "Currently playing" %}">
{{ station.name }}
</h4>
<div class="">[[ onAir.info ]]</div>
</template>
<template v-slot:empty>
<h4 class="title is-4" aria-description="{% trans "Currently playing" %}">{{ station.name }}</h4>
</template>
</a-player>
</div>
{% endif %}

View File

@ -2,13 +2,17 @@
List item for a podcast.
{% endcomment %}
{% load aircox %}
<div class="podcast">
{# comment #}
{% comment %}
{% if object.embed %}
{{ object.embed|safe }}
{% else %}
{# endcomment #}
<audio src="{{ object.url }}" controls>
{% endif %}
{% endcomment %}
<a-sound-item :data="{{ object|json }}" :player="player"
:actions="['play','queue']" @click="player.play(item)">
</a-sound-item>
</div>