work on player

This commit is contained in:
bkfox
2020-10-27 20:52:46 +01:00
parent 2a0d0b1758
commit 063d1f194e
14 changed files with 477 additions and 200 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,16 @@
{% extends "aircox/page_detail.html" %}
{% comment %}List of a show's episodes for a specific{% endcomment %}
{% load i18n %}
{% load i18n aircox %}
{% block head_extra %}
<script id="page">
window.addEventListener('load', ev => {
Vue.set(aircox.app, 'page', {
podcasts: new aircox.Set(aircox.Sound, {items: {{ podcasts|json|safe }}})
});
});
</script>
{% endblock head_extra %}
{% include "aircox/program_sidebar.html" %}
@ -38,10 +48,19 @@
{% if podcasts %}
<section class="column">
<h5 class="title is-5">{% trans "Podcasts" %}</h5>
<a-playlist v-if="page" :set="page.podcasts"
name="{{ page.title }}"
:player="player" :actions="['play']"
@select="player.playItems('queue', $event.item)">
<template v-slot:header>
<h5 class="title is-5">{% trans "Podcasts" %}</h5>
</template>
</a-playlist>
{% comment %}
{% for object in podcasts %}
{% include "aircox/widgets/podcast_item.html" %}
{% endfor %}
{% endcomment %}
</section>
{% endif %}
</div>

View File

@ -0,0 +1,8 @@
{% block sidebar_title %}
{% with program.title as program %}
{% blocktrans %}Recently on {{ program }}{% endblocktrans %}
{% endwith %}
{% endblock %}

View File

@ -12,7 +12,7 @@ List item for a podcast.
{% endif %}
{% endcomment %}
<a-sound-item :data="{{ object|json }}" :player="player"
:actions="['play','queue']" @click="player.play(item)">
:actions="['play']" @click="player.play(item)">
</a-sound-item>
</div>

View File

@ -2,6 +2,7 @@ import random
import json
from django import template
from django.utils.safestring import mark_safe
from aircox.models import Page, Diffusion, Log