Commit 72af2ea2 authored by Simon Daron's avatar Simon Daron
Browse files

Rewriting Whats On Air as separated view

parent 9d78b06b
......@@ -15,6 +15,7 @@ urlpatterns = patterns('',
url(r'^ckeditor/', include('ckeditor.urls')),
url(r'^get$', 'panikweb.views.get', name='get'),
url(r'^player$', 'panikweb.views.player', name='player'),
url(r'^what$', 'panikweb.views.what', name='what'),
(r'^api/v2/', include('fiber.rest_api.urls')),
(r'^admin/fiber/', include('fiber.admin_urls')),
......
......@@ -169,12 +169,10 @@ class Get(TemplateView):
get = Get.as_view()
class Player(TemplateView):
template_name = 'player.html'
class WhatsOnAir(TemplateView):
template_name = 'whatsonair.html'
def get_context_data(self, **kwargs):
context = super(Player, self).get_context_data(**kwargs)
context = super(WhatsOnAir, self).get_context_data(**kwargs)
now = datetime.now()
date_start = now - timedelta(days=1)
date_end = now + timedelta(days=1)
......@@ -198,7 +196,18 @@ class Player(TemplateView):
context['episode'] = episode
context['emission'] = emission
context['emissions'] = Emission.objects.all().order_by('title')
return context
what = WhatsOnAir.as_view()
class Player(TemplateView):
template_name = 'player.html'
def get_context_data(self, **kwargs):
context = super(Player, self).get_context_data(**kwargs)
#context['whatsonair'] = WhatsOnAir.as_view() #HOW TO PRELOAD WHATSONAIR?
return context
player = Player.as_view()
/******************/
/*HTML TAG DISPLAYS */
/******************/
audio {display:none;}
a {
color:black;
text-decoration: none;
......@@ -177,7 +176,7 @@ ul.inline li{
.right{float:right;margin-left:1em;}
.left{float:left;margin-left:1em;}
.smooth{opacity:0.5;}
.hidden(display:none;)
.hidden{display:none;}
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
......
......@@ -27,7 +27,7 @@
}
/* FONTS */
#player .current{
#player .whatsOnAir{
font-family: "RegloBold";
}
#metaNav {
......@@ -261,8 +261,7 @@ button.tag {
#player img {border-width:2px;border-style:solid;}
#player .current{
margin-top:1em;
#player .whatsOnAir{
}
#player .playlist .item {
......@@ -435,25 +434,25 @@ button.tag {
margin-right:2em;
}
/**** SCREEN SIZE ADAPTATIONS ****/
html { font-size: 70%; }
html #main{ font-size: 70%; }
body { font-size: 1em;}
@media screen and (max-width:400px){
@media screen and (max-width:475px){
#metaNav .iconLabel {display:none;}
}
@media (max-width: 300px) {
html { font-size: 70%; }
html #main{ font-size: 70%; }
}
@media (min-width: 500px) {
html { font-size: 80%; }
html #main{ font-size: 80%; }
}
@media (min-width: 700px) {
html { font-size: 100%; }
html #main{ font-size: 100%; }
}
@media (min-width: 1200px) {
html { font-size: 110%; }
html #main{ font-size: 110%; }
}
......@@ -5,31 +5,14 @@
<span class="control icon-volume-up resymbol huge"></span>
<span class="label">&nbsp;en direct</span>
</button>
<div class="current">
{% if episode %}
{% include "episodes/inline.html" with date="daytime" %}
{% for schedule in schedules %}
<div>{{ schedule.datetime|date:"l G:i" }}
<!--<div class="time">{{ schedule.datetime|date:"G:i" }}</div>-->
{% if schedule.rerun %} <span class="smooth">(rediff)</span> {% endif %}</div>
{% endfor %}
{% elif emission %}
{% include "episodes/inline.html" with date="daytime" %}
{% for schedule in schedules %}
<div>{{ schedule.datetime|date:"l G:i" }}
<!--<div class="time">{{ schedule.datetime|date:"G:i" }}</div>-->
{% if schedule.rerun %} <span class="smooth">(rediff)</span> {% endif %}</div>
{% endfor %}
{% else %}
<div>Non-stop (probably)</div>
{% endif %}
<div class="whatsOnAir">{{ whatsonair }}{% include "whatsonair.html" %}
</div>
<audio id="DirectStreamPanik" class="hidden" tabindex="0" src="http://streaming.domainepublic.net:8000/radiopanik.ogg" controls="controls">
</audio>
<div class="metas">
<a title="Get the stream on your player!" class="resymbol icon-download" href="http://streaming.domainepublic.net:8000/radiopanik.ogg.m3u"></a>
<button title="Show/Hidden HTML5 audio player" onclick="$('#DirectStreamPanik').toggleClass('hidden');$(this).toggleClass('icon-eye-open icon-eye-close');return false;" class="icon-eye-open"></button>
</div>
<audio id="DirectStreamPanik" tabindex="0" src="http://streaming.domainepublic.net:8000/radiopanik.ogg" controls="controls">
</audio>
<script type="text/javascript">
$(function() {
$("[data-audio-id]").click(function(e) {
......
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