fixed active line #88

This commit is contained in:
Oskar Hahn 2012-04-18 18:07:24 +02:00
parent e9e9fa54b2
commit 0dde1738cf
3 changed files with 8 additions and 2 deletions

View File

@ -68,6 +68,11 @@ class Slide(object):
self.weight = weight
self.name = name
@property
def active(self):
from api import get_active_slide
return get_active_slide(True) == self.key
def get_items(self):
try:
return self.model.objects.all()

View File

@ -2,7 +2,7 @@ $(function() {
// activate an element to show it on projector
$('.activate_link').click(function(event) {
event.preventDefault();
link = $(this);
var link = $(this);
$.ajax({
type: 'GET',
url: $(this).attr('href'),
@ -12,6 +12,7 @@ $(function() {
$('.activate_link').removeClass('active');
$('li').removeClass('activeline');
link.addClass('active');
link.parent().addClass('activeline');
},
error: function () {
alert("Ajax Error");

View File

@ -2,7 +2,7 @@
{% load i18n %}
<ul style="line-height: 180%">
<li>
<li class="{% if slides.active %}activeline{% endif %}">
<a href="{% url projector_activate_slide slides.key %}" class="activate_link {% if slides.active %}active{% endif %}">
<div></div>
</a>