work on admin interface, player, list of sounds

This commit is contained in:
bkfox
2016-08-10 00:58:05 +02:00
parent f5dbc93f7f
commit 021b2a116a
19 changed files with 566 additions and 298 deletions

View File

@ -56,6 +56,8 @@ Options:
{% endif %}
{% endwith %}
</nav>
{% elif url and url_text %}
<nav><a href="{{ url }}">{{ url_text }}</a></nav>
{% endif %}
</ul>

View File

@ -0,0 +1,45 @@
{% load staticfiles %}
{% load i18n %}
<audio preload="metadata">
{% trans "Your browser does not support the <code>audio</code> element." %}
{% for stream in streams %}
<source src="{{ stream }}" />
{% endfor %}
</audio>
<div class="playlist">
<li class='item list_item flex_row' style="display: none;">
<div class="button">
<img src="{% static "cms/images/play.png" %}" class="play"
title="{% trans "play" %}" />
<img src="{% static "cms/images/pause.png" %}" class="pause"
title="{% trans "pause" %}" />
<img src="{% static "cms/images/loading.png" %}" class="loading"
title="{% trans "loading..." %}" />
</div>
<div class="flex_item">
<h3 class="title flex_item">{{ self.live_title }}</h3>
<div class="content flex_row">
<span class="info duration flex_item"></span>
<span class="actions">
<a class="action detail" title="{% trans "more informations" %}"></a>
<a class="action remove" title="{% trans "remove this sound" %}"></a>
</span>
</div>
</div>
</li>
</div>
<div class="controls">
<span class="progress">
<span class="info duration"></span>
<progress class="flex_item progress" value="0" max="1"></progress>
</span>
<input type="checkbox" class="single" id="player_single_mode">
<label for="player_single_mode" class="info"
title="{% trans "enable and disable single mode" %}"></label>
</div>

View File

@ -1,22 +1,37 @@
{% load static %}
{% load i18n %}
{# TODO: complete archive podcast -> info #}
<div class="list_item sound">
<a onclick="player.select(player.playlist.add(new Sound(
<script>
function add_sound_{{ item.id }}(event) {
var sound = new Sound(
title='{{ item.name|escape }}',
detail='{{ item.detail_url }}',
duration={{ item.duration|date:"H*3600+i*60+s" }},
streams='{{ item.url }}')));" class="flex_row">
streams='{{ item.url }}',
{% if page and page.cover %}cover='{{ page.icon }}'{% endif %}
);
sound = player.playlist.add(sound);
if(event.target.dataset.action != 'add')
player.select(sound, true);
}
</script>
<a class="list_item sound flex_row" onclick="add_sound_{{ item.id }}(event)">
<img src="{% static "cms/images/listen.png" %}" class="icon"/>
<h3 class="flex_item">{{ item.name }}</h3>
<span class="info">
<time class="info">
{% if item.duration.hour > 0 %}
{{ item.duration|date:'H:i:s' }}
{% else %}
{{ item.duration|date:'i:s' }}
{% endif %}
</span>
</a>
</div>
</time>
<img src="{% static "cms/images/add.png" %}" class="icon"
data-action='add' alt="{% trans "add this sound to the playlist" %}"/>
</a>