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

Add view for emissions

parent bfb9698f
...@@ -12,6 +12,7 @@ urlpatterns = patterns('', ...@@ -12,6 +12,7 @@ urlpatterns = patterns('',
url(r'^onair.json$', 'panikweb.views.onair', name='onair'), url(r'^onair.json$', 'panikweb.views.onair', name='onair'),
url(r'^program$', 'panikweb.views.program', name='program'), url(r'^program$', 'panikweb.views.program', name='program'),
url(r'^grid$', 'panikweb.views.grid', name='grid'), url(r'^grid$', 'panikweb.views.grid', name='grid'),
url(r'^emissions/$', 'panikweb.views.emissions', name='emissions'),
url(r'^emissions/', include('emissions.urls')), url(r'^emissions/', include('emissions.urls')),
url(r'^ckeditor/', include('ckeditor.urls')), url(r'^ckeditor/', include('ckeditor.urls')),
url(r'^get$', 'panikweb.views.get', name='get'), url(r'^get$', 'panikweb.views.get', name='get'),
......
...@@ -182,6 +182,16 @@ class News(TemplateView): ...@@ -182,6 +182,16 @@ class News(TemplateView):
news = News.as_view() 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): class Get(TemplateView):
template_name = 'get.html' template_name = 'get.html'
...@@ -220,7 +230,8 @@ def onair(request): ...@@ -220,7 +230,8 @@ def onair(request):
if d.get('emission'): if d.get('emission'):
d['emission'] = { d['emission'] = {
'title': d['emission'].title, 'title': d['emission'].title,
'url': d['emission'].get_absolute_url() 'url': d['emission'].get_absolute_url(),
'schedules': list(d['emission'].get_schedules())
} }
return d return d
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
border-color:#fff; border-color:#fff;
color:white !important; color:white !important;
} }
#player.simple *, #Player a{ #player.simple *, #Player a, #Player button{
color:white !important; color:white !important;
} }
#player.simple .playlist{ #player.simple .playlist{
......
{% if src %} {% if src %}
<span class="controls small">
<button class="icon-play"></button>
<a class="icon-download" href="{{ src.url }}"></a>
</span>
<audio <audio
id="Audio-{{ id }}" id="Audio-{{ id }}"
{% if preload %}preload="{{ preload }}"{% endif%} {% if preload %}preload="{{ preload }}"{% endif%}
class="hidden {{ class }}" class="{{ class }}"
src="{{ src }}" src="{{ src }}"
{% if controls %}controls="{{ controls }}"{% endif%} {% if controls %}controls="{{ controls }}"{% endif%}
></audio> ></audio>
{% else %}
<div class="icon-ban-circle ">No Sound URL given</div>
{% endif%} {% endif%}
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<ul class="small custom list columns padded"> <ul class="small custom list columns padded">
{% for sound in sounds %} {% for sound in sounds %}
<li class="item ellipsis"> <li class="item ellipsis">
<a href="{{ sound.url }}"> {% include "includes/audio.html" with src=sound.file %}
{{ sound.episode }} {{ sound.episode }}
</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </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