summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-05-27 19:37:28 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-05-27 19:37:28 (GMT)
commit66a8d7ec50ac949d0cc3b14f9d76f35eb4f4d553 (patch)
tree15af15aa9c995f295cfe9a74701127a16e8b8a88
parent11bf1e04f7814722ce27fc6a7dab194c68c1ca5f (diff)
parenta1487772e667436e2274dece86cb40d2e58632a7 (diff)
merged stable into master
-rw-r--r--program/models.py22
-rw-r--r--program/templates/show_detail.html13
-rw-r--r--program/views.py3
-rw-r--r--requirements.txt2
4 files changed, 29 insertions, 11 deletions
diff --git a/program/models.py b/program/models.py
index 52b5517..7f9d665 100644
--- a/program/models.py
+++ b/program/models.py
@@ -335,14 +335,20 @@ class ProgramSlot(models.Model):
def save(self, *args, **kwargs):
if self.pk:
old = ProgramSlot.objects.get(pk=self.pk)
- if self.rrule != old.rrule \
- or self.byweekday != old.byweekday \
- or self.show != old.show \
- or self.dstart != old.dstart \
- or self.tstart != old.tstart \
- or self.tend != old.tend \
- or self.is_repetition != old.is_repetition:
- raise ValidationError(u"only until can be changed")
+ if self.rrule != old.rrule:
+ raise ValidationError(u"Recurrence rule cannot ba changed")
+ if self.byweekday != old.byweekday:
+ raise ValidationError(u"Weekday cannot be changed")
+ if self.show != old.show:
+ raise ValidationError(u"Show cannot be changed")
+ if self.dstart != old.dstart:
+ raise ValidationError(u"First date cannot ba changed")
+ if self.tstart != old.tstart:
+ raise ValidationError(u"Start time cannot be changed")
+ if self.tend != old.tend:
+ raise ValidationError(u"End time cannot be changed")
+ if self.is_repetition != old.is_repetition:
+ raise ValidationError(u"Is repetition cannot be changed")
else:
old = False
diff --git a/program/templates/show_detail.html b/program/templates/show_detail.html
index 7993287..e3b2bdb 100644
--- a/program/templates/show_detail.html
+++ b/program/templates/show_detail.html
@@ -73,9 +73,20 @@
<div class="title">{{ note.title }}</div>
</li>
{% endfor %}
+ {% if show.predecessor and show.predecessor.notes.all %}
+ {% if show.name != show.predecessor.name %}
+ <h3>Davor als <a href="{% url "show-detail" show.predecessor.slug %}">{{ show.predecessor.name }}</a></h3>
+ {% endif %}
+ {% for note in show.predecessor.notes.all reversed %}
+ <li>
+ <a href="{% url "timeslot-detail" note.timeslot.id %}"
+ title="{{ note.title }}">{{ note.start|date:"d. M Y" }}:</a>
+ <div class="title">{{ note.title }}</div>
+ </li>
+ {% endfor %}
+ {% endif %}
</ul>
{% endif %}
-
</div>
</body>
diff --git a/program/views.py b/program/views.py
index b4c2e8c..5dc82dd 100644
--- a/program/views.py
+++ b/program/views.py
@@ -50,7 +50,7 @@ class ShowListView(ListView):
class ShowDetailView(DetailView):
- queryset = Show.objects.filter(is_active=True).exclude(id=1).distinct()
+ queryset = Show.objects.all().exclude(id=1)
template_name = 'show_detail.html'
@@ -205,6 +205,7 @@ def json_day_schedule(request, year=None, month=None, day=None):
'id': ts.programslot.show.id,
'automation-id': -1
}
+
if ts.programslot.automation_id:
entry['automation-id'] = ts.programslot.automation_id
elif ts.programslot.show.automation_id:
diff --git a/requirements.txt b/requirements.txt
index e01467b..b895f65 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,4 +3,4 @@ MySQL-python==1.2.5
Pillow==3.2.0
PyYAML==3.11
django-tinymce==2.3.0
-python-dateutil==2.5.2
+python-dateutil==2.5.3