Browse files

Highlighting of the currently playing element in the planning view

  • Loading branch information...
1 parent a4ae514 commit a8cf955c8bdade63d34b512afbcf0814f4da97d2 raph committed Jul 1, 2011
View
5 bin/rzz/audiosources/views.py
@@ -355,12 +355,15 @@ def show_active_planning(request):
)
for i in range(7)
]
+ active_el = planning.get_playing_element()
+ active_el = active_el if active_el.type == "single" else None
return direct_to_template(request,
'audiosources/show_active_planning.html',
extra_context={
'days':elements,
- 'today':weekdays[date.today().weekday()]
+ 'today':weekdays[date.today().weekday()],
+ 'active_el': active_el
})
def duplicate_planning(request):
View
4 bin/rzz/templates/audiosources/show_active_planning.html
@@ -25,8 +25,8 @@
<div class="day_elements" id="{{ day }}_element" {% if day == today %}{% else %}style="display:none;"{% endif %}>
{% for element in elements %}
{% with element.source as source %}
- <div class="planning_element">
- <h4>{{ element.time_start }} - {{ source.title }}</h4>
+ <div class="planning_element {% if element == active_el %}active_element{% endif %}">
+ <h4>{{ element.time_start|time:"H\hi" }} - {{ source.title }}</h4>
<p>{{ source.description }}</p>
</div>
{% endwith %}
View
6 share/media/css/radio_front.css
@@ -125,3 +125,9 @@ p, ul {
padding:0px;
padding-right:5px;
}
+
+.active_element {
+ background-color:#EDC;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+}

0 comments on commit a8cf955

Please sign in to comment.