From dfd55f706de1f588eb0573b51c3e4ddba8612e97 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 10 Mar 2021 17:25:59 +0100 Subject: minor template changes and cleanups diff --git a/program/templates/v2/day_schedule.html b/program/templates/v2/day_schedule.html index e97d5ad..ec1a375 100644 --- a/program/templates/v2/day_schedule.html +++ b/program/templates/v2/day_schedule.html @@ -5,7 +5,7 @@
-

{{ day|date:"l, d.m.Y" }}

+

{{ day|date:"l, d.m.Y" }}

{% for timeslot in timeslots %} diff --git a/program/templates/v2/host_list.html b/program/templates/v2/host_list.html index b2c1542..b8a4677 100644 --- a/program/templates/v2/host_list.html +++ b/program/templates/v2/host_list.html @@ -6,6 +6,7 @@

Sendungsmachende A-Z

+
{% for host in host_list %} diff --git a/program/templates/v2/recommendation_list.html b/program/templates/v2/recommendation_list.html index a2b6b54..63bc556 100644 --- a/program/templates/v2/recommendation_list.html +++ b/program/templates/v2/recommendation_list.html @@ -6,6 +6,7 @@

Programmhinweise

+
{% for recommendation in recommendation_list %}
diff --git a/program/templates/v2/show_detail.html b/program/templates/v2/show_detail.html index ded171e..e8c4c8f 100644 --- a/program/templates/v2/show_detail.html +++ b/program/templates/v2/show_detail.html @@ -5,7 +5,6 @@
-

{{ show.name }}

diff --git a/program/templates/v2/timeslot_detail.html b/program/templates/v2/timeslot_detail.html index d4ac952..9af51ab 100644 --- a/program/templates/v2/timeslot_detail.html +++ b/program/templates/v2/timeslot_detail.html @@ -5,7 +5,6 @@
-

{{ timeslot.show.name }}

-- cgit v0.10.2 From a4c86bba07fedd42924ace38a6c404e7bb67564e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 10 Mar 2021 17:28:06 +0100 Subject: catetory vs category diff --git a/program/templates/v2/day_schedule.html b/program/templates/v2/day_schedule.html index ec1a375..113705d 100644 --- a/program/templates/v2/day_schedule.html +++ b/program/templates/v2/day_schedule.html @@ -23,7 +23,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in default_show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
@@ -45,7 +45,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in timeslot.show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
@@ -71,7 +71,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in default_show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
diff --git a/program/templates/v2/recommendation_list.html b/program/templates/v2/recommendation_list.html index 63bc556..c98cd72 100644 --- a/program/templates/v2/recommendation_list.html +++ b/program/templates/v2/recommendation_list.html @@ -21,7 +21,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in recommendation.show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
diff --git a/program/templates/v2/show_detail.html b/program/templates/v2/show_detail.html index e8c4c8f..0041cfa 100644 --- a/program/templates/v2/show_detail.html +++ b/program/templates/v2/show_detail.html @@ -29,7 +29,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
diff --git a/program/templates/v2/show_list.html b/program/templates/v2/show_list.html index 466cf77..8455425 100644 --- a/program/templates/v2/show_list.html +++ b/program/templates/v2/show_list.html @@ -21,7 +21,7 @@ {{ mf.abbrev }} {% endfor %} {% for lang in show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
diff --git a/program/templates/v2/timeslot_detail.html b/program/templates/v2/timeslot_detail.html index 9af51ab..cbb3559 100644 --- a/program/templates/v2/timeslot_detail.html +++ b/program/templates/v2/timeslot_detail.html @@ -15,16 +15,16 @@
{% for si in timeslot.show.showinformation.all %} - {{ si.abbrev }} + {{ si.abbrev }} {% endfor %} {% for st in timeslot.show.showtopic.all %} - {{ st.abbrev }} + {{ st.abbrev }} {% endfor %} {% for mf in timeslot.show.musicfocus.all %} - {{ mf.abbrev }} + {{ mf.abbrev }} {% endfor %} {% for lang in timeslot.show.language.all %} - {{ lang.slug }} + {{ lang.slug }} {% endfor %}
-- cgit v0.10.2 From ecc2c7362fb0517654e79e11deb80539d4395652 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 3 Mar 2021 16:56:59 +0100 Subject: add some more show/timeslot metadata to nowplaying info diff --git a/nop/views.py b/nop/views.py index 1237948..78e39a8 100644 --- a/nop/views.py +++ b/nop/views.py @@ -14,6 +14,7 @@ from datetime import datetime DB = 'nop' + class NopForm(forms.Form): date = forms.DateField( required=True, @@ -50,7 +51,7 @@ def _get_show(datetime=None): else: timeslot = TimeSlot.objects.get_or_create_current() except (ObjectDoesNotExist, MultipleObjectsReturned): - return {'start': None, 'id': None, 'name': None} + return {'start': None, 'timeslot-id': None, 'note': None, 'id': None, 'slug': None, 'name': None} else: try: note = timeslot.note @@ -58,9 +59,11 @@ def _get_show(datetime=None): note = None return {'start': _dtstring(timeslot.start.timetuple()), + 'timeslot-id': timeslot.id, + 'note': note, 'id': timeslot.show.id, - 'name': timeslot.show.name, - 'note': note} + 'slug': timeslot.show.slug, + 'name': timeslot.show.name} def _current(): @@ -76,8 +79,10 @@ def _current(): title = result.title album = result.album - return {'show': show['name'], - 'start': show['start'], + return {'start': show['start'], + 'timeslot': show['timeslot-id'], + 'show': show['slug'], + 'show-title': show['name'], 'artist': artist, 'title': title, 'album': album} @@ -87,8 +92,10 @@ def _bydate(year=None, month=None, day=None, hour=None, minute=None): show = _get_show(datetime(year, month, day, hour, minute)) if show['id'] and show['id'] not in settings.MUSIKPROG_IDS: - return [{'show': show['name'], - 'start': show['start'], + return [{'start': show['start'], + 'timeslot': show['timeslot-id'], + 'show': show['slug'], + 'show-title': show['name'], 'artist': None, 'title': None, 'album': None}] @@ -96,8 +103,10 @@ def _bydate(year=None, month=None, day=None, hour=None, minute=None): ts = int(time.mktime((int(year), int(month), int(day), int(hour), int(minute), 0, 0, 0, -1))) * 1000000 result = _which(ts).objects.using(DB).filter(carttype__exact='pool').filter(timestamp__lt=ts)[:5] - return [{'show': show['name'], - 'start': _dtstring(time.localtime(item.timestamp//1000000)), + return [{'start': _dtstring(time.localtime(item.timestamp//1000000)), + 'timeslot': show['timeslot-id'], + 'show': show['slug'], + 'show-title': show['name'], 'artist': item.artist, 'title': item.title, 'album': item.album} for item in result] -- cgit v0.10.2