slot.currently_playing = True
break
else:
- program[0].currently_playing = True # first slot, nonstop
+ for slot in program:
+ if slot.get_duration() and slot.datetime > now:
+ slot.next_playing = True
+ break
return {
'program': program,
COMBO_WELCOME_PAGE_PATH = None
AUTH_USER_MODEL = 'aa.User'
+THUMBNAIL_PRESERVE_FORMAT = True
try:
from .local_settings import *
max-width: 100%;
position: relative;
display: flex;
+ height: 350px;
div.around-nav-previous, div.around-nav-next {
flex: 1;
min-width: 20px;
text-align: center;
background: $primary;
height: 50px;
+ border: 1px solid #666;
button {
line-height: 45px;
color: white;
}
}
div.around-nav-inner {
+ background: white;
overflow: hidden;
max-width: 100%;
margin-bottom: 250px;
+ border-top: 1px solid black;
}
div.around-nav-inner-2 {
position: relative;
width: 4000px;
transition: transform linear 0.2s;
div.around-block {
- border: 1px solid #666;
- border-right: none;
+ border-right: 1px solid #666;
+ box-sizing: border-box;
+ padding: 0 1rem;
background: white;
display: block;
width: 244px;
float: left;
- &.currently-playing {
+ &.highlight {
background: $primary;
color: white;
}
}
div.around-slot-details {
div.around-details {
+ box-sizing: border-box;
display: none;
position: absolute;
left: 0;
- top: 60px;
+ top: 50px;
border: 1px solid #666;
background: white;
width: 100%;
+ p {
+ margin: 1rem;
+ }
img {
- float: left;
+ float: right;
+ margin-left: 1rem;
+ border: none;
}
}
}
}
$('.around-block').on('click', function () {
+ $('.around-block.highlight').removeClass('highlight');
+ $(this).addClass('highlight');
$('.around-details').hide();
var block_id = $(this).data('block');
$('.around-details[data-block="' + block_id + '"]').show();
+ var $inner = $('.around-nav-inner-2');
+ var translation = block_id - 1;
+ $inner.data('idx', translation);
+ $inner.css('transform', 'translateX(-' + (translation*245) + 'px)');
});
$('.around-nav-inner-2').data('idx', 0);
$inner.data('idx', translation);
$inner.css('transform', 'translateX(-' + (translation*245) + 'px)');
});
+ $('.around-block.highlight').click();
$('#ticker li:not(:first)');
if (ticker_interval) clearInterval(ticker_interval);
+{% load thumbnail %}
<div class="around-nav">
<div class="around-nav-previous"><button>«</button></div>
<div class="around-nav-inner">
<div class="around-nav-inner-2">
{% for slot in program %}
-<div class="around-block {% if slot.currently_playing %}currently-playing{% endif %}" data-block="{{forloop.counter}}">
+<div class="around-block {% if slot.currently_playing or slot.next_playing %}highlight{% endif %}" data-block="{{forloop.counter}}">
<h5>{% firstof slot.episode.title slot.emission.title slot.label %}</h5>
<span>{{slot.datetime|date:"l G:i"}}</span>
</div>
<div class="around-details" data-block="{{forloop.counter}}">
{% if slot.emission %}
{% if slot.emission.image %}
- <div class="emission-logo"><img class="logo" src="{{ slot.emission.image.url }}"/></div>
+ {% thumbnail slot.emission.image "600x300" crop="50% 25%" as im %}
+ <div class="emission-logo"><img class="logo" src="{{ im.url }}"/></div>
+ {% endthumbnail %}
{% endif %}
<p>{{slot.emission.text|safe}}</p>
<p><a class="button" href="{% url 'emission-view' slug=slot.emission.slug %}">Page de l'émission</a></p>