diff options
-rw-r--r-- | TODO.md | 8 | ||||
-rw-r--r-- | program/admin.py | 7 | ||||
-rw-r--r-- | program/templates/show_detail.html | 3 | ||||
-rw-r--r-- | program/templates/timeslot_detail.html | 5 | ||||
-rw-r--r-- | program/utils.py | 2 | ||||
-rw-r--r-- | program/views.py | 2 |
6 files changed, 15 insertions, 12 deletions
@@ -1,5 +1,9 @@ -- [ ] list notes of predecessor, if available, on show detail page -- [ ] list notes of successor, if available to show detail page +- [*] list notes of predecessor, if available, on show detail page +- [ ] list notes of successor, if available, on show detail page +- [*] optimize the export for the day schedule +- [ ] handle exceptions better +- [ ] optimize the selection of a predecessor for a show +- [ ] optimize the selection of a timeslot for a note - [ ] add management command to automatically renew program slots - [ ] add jingle field (File) to Show model - [ ] customize the admin interface for program slot diff --git a/program/admin.py b/program/admin.py index bb47ca2..d871e16 100644 --- a/program/admin.py +++ b/program/admin.py @@ -65,7 +65,7 @@ class ProgramSlotAdmin(admin.ModelAdmin): actions = ('renew',) inlines = (TimeSlotInline,) fields = (('rrule', 'byweekday'), ('dstart', 'tstart', 'tend'), 'until', 'is_repetition', 'automation_id') - list_display = ('show', 'byweekday', 'rrule', 'tstart', 'tend', 'until') + list_display = ('get_show_name', 'byweekday', 'rrule', 'tstart', 'tend', 'until') list_filter = ('byweekday', 'rrule', 'is_repetition', 'is_active') ordering = ('byweekday', 'dstart') save_on_top = True @@ -82,6 +82,11 @@ class ProgramSlotAdmin(admin.ModelAdmin): self.message_user(request, message) renew.short_description = _("Renew selected program slots") + def get_show_name(self, obj): + return obj.show.name + get_show_name.admin_order_field = 'show' + get_show_name.short_description = "Show" + class ProgramSlotInline(admin.TabularInline): model = ProgramSlot diff --git a/program/templates/show_detail.html b/program/templates/show_detail.html index e3b2bdb..47d20a1 100644 --- a/program/templates/show_detail.html +++ b/program/templates/show_detail.html @@ -57,9 +57,6 @@ {% if show.website %} <strong>Website:</strong> <a href="{{ show.website }}">{{ show.website }}</a><br/> {% endif %} - {% if show.cba_series_id %} - <strong>CBA-Link:</strong> <a href="http://cba.fro.at/series/{{ show.cba_series_id }}">CBA</a><br/> - {% endif %} </p> {% if show.notes.all %} diff --git a/program/templates/timeslot_detail.html b/program/templates/timeslot_detail.html index 5133320..cfe2b7b 100644 --- a/program/templates/timeslot_detail.html +++ b/program/templates/timeslot_detail.html @@ -1,6 +1,6 @@ <html> <head> - <title>Sendung: {{ timeslot }} — Radio Helsinki - Freies Radio Graz</title> + <title>Sendung: {{ timeslot.show.name }} — Radio Helsinki - Freies Radio Graz</title> </head> <body> @@ -50,9 +50,6 @@ {% if timeslot.show.website %} <strong>Website:</strong> <a href="{{ timeslot.show.website }}">{{ timeslot.show.website }}</a><br/> {% endif %} - {% if timeslot.show.cba_series_id %} - <strong>CBA-Link:</strong> <a href="http://cba.fro.at/series/{{ timeslot.show.cba_series_id }}">CBA</a><br/> - {% endif %} </p> </div> diff --git a/program/utils.py b/program/utils.py index 587e83d..40bcb2a 100644 --- a/program/utils.py +++ b/program/utils.py @@ -25,7 +25,7 @@ def get_automation_id_choices(): with open(cached_shows, 'w') as cache: cache.write(shows_json) - shows = [(s['id'], s['title']) for s in shows_list] + shows = [(s['id'], '%d | %s' % (s['id'], s['title'])) for s in shows_list] return shows diff --git a/program/views.py b/program/views.py index 5dc82dd..6a53e82 100644 --- a/program/views.py +++ b/program/views.py @@ -195,7 +195,7 @@ def json_day_schedule(request, year=None, month=None, day=None): else: today = datetime.strptime('%s__%s__%s__00__00' % (year, month, day), '%Y__%m__%d__%H__%M') - timeslots = TimeSlot.objects.get_24h_timeslots(today) + timeslots = TimeSlot.objects.get_24h_timeslots(today).select_related('programslot') schedule = [] for ts in timeslots: entry = { |