diff options
-rw-r--r-- | program/models.py | 22 | ||||
-rw-r--r-- | program/templates/show_detail.html | 13 | ||||
-rw-r--r-- | program/views.py | 3 | ||||
-rw-r--r-- | requirements.txt | 2 |
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 |