Commit d2b77130 authored by Simon Daron's avatar Simon Daron
Browse files

Add view for emissions

parent bfb9698f
......@@ -12,6 +12,7 @@ urlpatterns = patterns('',
url(r'^onair.json$', 'panikweb.views.onair', name='onair'),
url(r'^program$', 'panikweb.views.program', name='program'),
url(r'^grid$', 'panikweb.views.grid', name='grid'),
url(r'^emissions/$', 'panikweb.views.emissions', name='emissions'),
url(r'^emissions/', include('emissions.urls')),
url(r'^ckeditor/', include('ckeditor.urls')),
url(r'^get$', 'panikweb.views.get', name='get'),
......
......@@ -182,6 +182,16 @@ class News(TemplateView):
news = News.as_view()
class Emissions(TemplateView):
template_name = 'emissions.html'
def get_context_data(self, **kwargs):
context = super(Emissions, self).get_context_data(**kwargs)
context['emissions'] = Emission.objects.all().order_by('title')
return context
emissions = Emissions.as_view()
class Get(TemplateView):
template_name = 'get.html'
......@@ -220,7 +230,8 @@ def onair(request):
if d.get('emission'):
d['emission'] = {
'title': d['emission'].title,
'url': d['emission'].get_absolute_url()
'url': d['emission'].get_absolute_url(),
'schedules': list(d['emission'].get_schedules())
}
return d
......
......@@ -41,7 +41,7 @@
border-color:#fff;
color:white !important;
}
#player.simple *, #Player a{
#player.simple *, #Player a, #Player button{
color:white !important;
}
#player.simple .playlist{
......
{% if src %}
<span class="controls small">
<button class="icon-play"></button>
<a class="icon-download" href="{{ src.url }}"></a>
</span>
<audio
id="Audio-{{ id }}"
{% if preload %}preload="{{ preload }}"{% endif%}
class="hidden {{ class }}"
class="{{ class }}"
src="{{ src }}"
{% if controls %}controls="{{ controls }}"{% endif%}
></audio>
{% else %}
<div class="icon-ban-circle ">No Sound URL given</div>
{% endif%}
......@@ -5,9 +5,9 @@
<ul class="small custom list columns padded">
{% for sound in sounds %}
<li class="item ellipsis">
<a href="{{ sound.url }}">
{{ sound.episode }}
</a>
{% include "includes/audio.html" with src=sound.file %}
{{ sound.episode }}
</li>
{% endfor %}
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment