From c547dce30366b3a6097008086cbc0b917c6a2f85 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Wed, 6 Jan 2016 20:03:56 +0100 Subject: formated templates and updated templatetags diff --git a/program/templates/boxes/broadcastformat.html b/program/templates/boxes/broadcastformat.html index 76ee382..c12e635 100644 --- a/program/templates/boxes/broadcastformat.html +++ b/program/templates/boxes/broadcastformat.html @@ -1,10 +1,11 @@ {% if broadcastformats %} -
-
Legende
- {% for broadcastformat in broadcastformats %} -
- {{ broadcastformat.format }} -
- {% endfor %} -
+
+
Legende
+ {% for bf in broadcastformat_list %} +
+ {{ bf.format }} +
+ {% endfor %} +
{% endif %} diff --git a/program/templates/boxes/current.html b/program/templates/boxes/current.html index ba1df21..4f81906 100644 --- a/program/templates/boxes/current.html +++ b/program/templates/boxes/current.html @@ -1,60 +1,65 @@ - - Current program box + + Current program box - - {% if previous or current or next or after_next %} -
-
Programm derzeit
-
- - - - - - - - - - - - - - - - - - - - - - - - -
{{ previous.start|date:"H:i" }}  -

{{ previous.show.name }}

-
{{ current.start|date:"H:i" }} -

{{ current.show.name }}

- {% if current.note %} -

{{ current.note.title }}

- {% else %} -

{{ current.show.short_description }}

- {% endif %} -
{{ next.start|date:"H:i" }}  -

{{ next.show.name }}

-
{{ after_next.start|date:"H:i" }}  -

{{ after_next.show.name }}

-
-
-
- {% endif %} - +{% if previous_timeslot or current_timeslot or next_timeslot or after_next_timeslot %} +
+
Programm derzeit
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
{{ previous_timeslot.start|date:"H:i" }}  +

+ {{ previous_timeslot.show.name }} +

+
{{ current_timeslot.start|date:"H:i" }} +

+ {{ current_timeslot.show.name }} +

+ {% if current_timeslot.note %} +

{{ current_timeslot.note.title }}

+ {% else %} +

{{ current_timeslot.show.short_description }}

+ {% endif %} +
{{ next_timeslot.start|date:"H:i" }}  +

{{ next_timeslot.show.name }} +

+
{{ after_next_timeslot.start|date:"H:i" }}  +

+ {{ after_next_timeslot.show.name }} +

+
+
+
+{% endif %} diff --git a/program/templates/boxes/musicfocus.html b/program/templates/boxes/musicfocus.html index 01fffae..292cea0 100644 --- a/program/templates/boxes/musicfocus.html +++ b/program/templates/boxes/musicfocus.html @@ -1,14 +1,15 @@ {% if musicfoci %} -
-
Musiktendenz
-
-
    - {% for item in musicfoci %} -
  • - {{ item }} -
  • - {% endfor %} -
-
-
+
+
Musiktendenz
+
+
    + {% for mf in musicfocus_list %} +
  • + {{ mf.focus }} +
  • + {% endfor %} +
+
+
{% endif %} diff --git a/program/templates/boxes/recommendation.html b/program/templates/boxes/recommendation.html index d2bb7d2..3f4429e 100644 --- a/program/templates/boxes/recommendation.html +++ b/program/templates/boxes/recommendation.html @@ -1,40 +1,39 @@ - - Recomendations box + + Recomendations box - {% if recommendation_list %} -
-
Programmhinweise
-
- - {% for item in recommendation_list %} - - - - - - {% endfor %} -
   - {{ item.start|date:"d.m. H:i" }} - - {{ item.end|date:"H:i" }}
-

- {{ item.show.name }} -

-

- {% if item.note %} - {{ item.note.title }}
- {% else %} - {{ item.show.broadcastformat.format }}
- {% endif %} - [weiter] -

-
-
-
- {% endif %} +{% if recommendation_list %} +
+
Programmhinweise
+
+ + {% for recommendation in recommendation_list %} + + + + + + {% endfor %} +
   + {{ recommendation.start|date:"d.m. H:i" }} - {{ recommendation.end|date:"H:i" }}
+

+ {{ recommendation.show.name }} +

+

+ {% if recommendation.note %} + {{ recommendation.note.title }}
+ {% else %} + {{ recommendation.show.broadcastformat.format }}
+ {% endif %} + [weiter] +

+
+
+
+{% endif %} diff --git a/program/templates/boxes/showinformation.html b/program/templates/boxes/showinformation.html index ac4dc2c..52c40e0 100644 --- a/program/templates/boxes/showinformation.html +++ b/program/templates/boxes/showinformation.html @@ -1,14 +1,16 @@ {% if showinformations %} -
-
Sendungsinfo
-
-
    - {% for item in showinformations %} -
  • - {{ item }} -
  • - {% endfor %} -
-
-
+
+
Sendungsinfo
+
+ +
+
{% endif %} diff --git a/program/templates/boxes/showtopic.html b/program/templates/boxes/showtopic.html index 3a1938d..8561343 100644 --- a/program/templates/boxes/showtopic.html +++ b/program/templates/boxes/showtopic.html @@ -1,14 +1,16 @@ {% if showtopics %} -
-
Thema / Schwerpunkt
-
-
    - {% for item in showtopics %} -
  • - {{ item }} -
  • - {% endfor %} -
-
-
+
+
Thema / Schwerpunkt
+
+ +
+
{% endif %} diff --git a/program/templates/day_schedule.html b/program/templates/day_schedule.html index f338940..7a371e6 100644 --- a/program/templates/day_schedule.html +++ b/program/templates/day_schedule.html @@ -1,43 +1,42 @@ - Tagesansicht {{ day|date:"l, d.m.Y" }} — Radio Helsinki - Freies Radio Graz - - - - - - + Tagesansicht {{ day|date:"l, d.m.Y" }} — Radio Helsinki - Freies Radio Graz + + + + +
-
Kalender
-
-
-
+
Kalender
+
+
+
{% load content_boxes %}
-{% broadcastformat %} + {% broadcastformat %}
{% comment %} @@ -56,70 +55,76 @@ jQuery(document).ready(function() {

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

- {% for timeslot in timeslots %} - {% if forloop.first and timeslot.start != timeslot.get_previous_by_start.end %} -
-
{{ timeslot.get_previous_by_start.end|date:"H:i" }}
-
- {% for item in default_show.showinformation.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in default_show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in default_show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} -
-
-

{{ default_show.name }}

-

{{ default_show.short_description }}

-
-
- {% endif %} -
-
{{ timeslot.start|date:"H:i" }}
-
- {% for item in timeslot.show.showinformation.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in timeslot.show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in timeslot.show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} -
-
-

{{ timeslot.show.name }}

- {% if timeslot.note %} -

Heute: {{ timeslot.note.title }}

- {% else %} -

{{ timeslot.show.short_description }}

+ {% for timeslot in timeslots %} + {% if forloop.first and timeslot.start != timeslot.get_previous_by_start.end %} +
+
{{ timeslot.get_previous_by_start.end|date:"H:i" }}
+
+ {% for si in default_show.showinformation.all %} + {{ si.abbrev }} + {% endfor %} + {% for st in default_show.showtopic.all %} + {{ st.abbrev }} + {% endfor %} + {% for mf in default_show.musicfocus.all %} + {{ mf.abbrev }} + {% endfor %} +
+
+

{{ default_show.name }}

+

{{ default_show.short_description }}

+
+
{% endif %} -
-
- {% if timeslot.end != timeslot.get_next_by_start.start %} -
-
{{ timeslot.end|date:"H:i" }}
+
+
{{ timeslot.start|date:"H:i" }}
- {% for item in default_show.showinformation.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in default_show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in default_show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} + {% for si in timeslot.show.showinformation.all %} + {{ si.abbrev }} + {% endfor %} + {% for st in timeslot.show.showtopic.all %} + {{ st.abbrev }} + {% endfor %} + {% for mf in timeslot.show.musicfocus.all %} + {{ mf.abbrev }} + {% endfor %}
-

{{ default_show.name }}

-

{{ default_show.short_description }}

+

{{ timeslot.show.name }}

+ {% if timeslot.note %} +

Heute: {{ timeslot.note.title }}

+ {% else %} +

{{ timeslot.show.short_description }}

+ {% endif %}
- {% endif %} - {% endfor %} + {% if timeslot.end != timeslot.get_next_by_start.start %} +
+
{{ timeslot.end|date:"H:i" }}
+
+ {% for si in default_show.showinformation.all %} + {{ si.abbrev }} + {% endfor %} + {% for st in default_show.showtopic.all %} + {{ st.abbrev }} + {% endfor %} + {% for mf in default_show.musicfocus.all %} + {{ mf.abbrev }} + {% endfor %} +
+
+

{{ default_show.name }}

+

{{ default_show.short_description }}

+
+
+ {% endif %} + {% endfor %}
diff --git a/program/templates/host_detail.html b/program/templates/host_detail.html index 3d8e862..73182d6 100644 --- a/program/templates/host_detail.html +++ b/program/templates/host_detail.html @@ -9,22 +9,22 @@
Sendungen
- - {% for show in host.shows.all %} - {% if show.has_active_programslots %} - - {% else %} -
{{ show }}
- {% endif %} - {% endfor %} + {% for show in host.shows.all %} + {% if show.is_active %} + + {% else %} +
{{ show }}
+ {% endif %} + {% endfor %}
{% if host.email %} -
E-Mail Adresse: {{ host.email }}
+
E-Mail Adresse: {{ host.email }}
{% endif %} {% if host.website %} -
Website: {{ host.website }}
+
Website: {{ host.website }}
{% endif %} diff --git a/program/templates/host_list.html b/program/templates/host_list.html index d1c8427..ada9bf1 100644 --- a/program/templates/host_list.html +++ b/program/templates/host_list.html @@ -5,14 +5,14 @@
-

Sendungsmachende A-Z

-
-{% for host in host_list %} -
- {{ host.name }} +

Sendungsmachende A-Z

+
+ {% for host in host_list %} + + {% endfor %}
-{% endfor %} -
diff --git a/program/templates/recommendation_list.html b/program/templates/recommendation_list.html index 3836a35..8070b29 100644 --- a/program/templates/recommendation_list.html +++ b/program/templates/recommendation_list.html @@ -5,40 +5,41 @@
-

Programmhinweise

-
-{% for recommendation in recommendation_list %} -
-
- {% for si in recommendation.show.showinformation.all %} - {{ si.abbrev }} +

Programmhinweise

+
+ {% for recommendation in recommendation_list %} +
+
+ {% for si in recommendation.show.showinformation.all %} + {{ si.abbrev }} + {% endfor %} + {% for st in recommendation.show.showtopic.all %} + {{ st.abbrev }} + {% endfor %} + {% for mf in recommendation.show.musicfocus.all %} + {{ mf.abbrev }} + {% endfor %} +
+
+

+ {{ recommendation.show.name }}
+ vom {{ recommendation.start|date:"d.m. H:i" }}-{{ recommendation.end|date:"H:i" }}

+ {% if recommendation.note %} +

+ {{ recommendation.note.title }} +
{{ recommendation.note.content|safe }}
+ {% else %} +

{{ recommendation.show.broadcastformat.format }} +

+ {% endif %} +
+
{% endfor %} - {% for st in recommendation.show.showtopic.all %} - {{ st.abbrev }} - {% endfor %} - {% for mf in recommendation.show.musicfocus.all %} - {{ mf.abbrev }} - {% endfor %} -
-
-

- {{ recommendation.show.name }}
- vom {{ recommendation.start|date:"d.m. H:i" }}-{{ recommendation.end|date:"H:i" }} -

- {% if recommendation.note %} -

- {{ recommendation.note.title }} -

-
{{ recommendation.note.content|safe}}
- {% else %} -

- {{ recommendation.show.broadcastformat.format }} -

- {% endif %} -
-{% endfor %} -
diff --git a/program/templates/show_detail.html b/program/templates/show_detail.html index 0f4b302..3ab80ed 100644 --- a/program/templates/show_detail.html +++ b/program/templates/show_detail.html @@ -8,72 +8,73 @@
-
-
-

{{ show.name }}

- {% if show.id != 1 %} -

- {% for slot in show.programslots.all %} - {% if slot.has_active_timeslot %} - {{ slot }}
- {% endif %} - {% endfor %} -

- {% endif %} -
+
+
+

{{ show.name }}

+ {% if show.id != 1 %} +

+ {% for slot in show.programslots.all %} + {% if slot.is_active %} + {{ slot }}
+ {% endif %} + {% endfor %} +

+ {% endif %} +
-
-

{{ show.broadcastformat.format }}

- {% for item in show.showinformation.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} -
+
+

{{ show.broadcastformat.format }}

+ {% for item in show.showinformation.all %} + {{ item.abbrev }} + {% endfor %} + {% for item in show.showtopic.all %} + {{ item.abbrev }} + {% endfor %} + {% for item in show.musicfocus.all %} + {{ item.abbrev }} + {% endfor %} +
-
+
{{ show.short_description }}
{% if show.description %} -
{{ show.description|safe }}
+
{{ show.description|safe }}
{% endif %} {% if show.image and show.image_enabled %} -
image
+
image
{% endif %}

- {% for host in show.hosts.all %} - {{ host }}
- {% endfor %} - {% if show.email %} - Email: {{ show.email }}
- {% endif %} - {% if show.website %} - Website: {{ show.website }}
- {% endif %} - {% if show.cba_series_id %} - CBA-Link: CBA
- {% endif %} + {% for host in show.hosts.all %} + {{ host }}
+ {% endfor %} + {% if show.email %} + Email: {{ show.email }}
+ {% endif %} + {% if show.website %} + Website: {{ show.website }}
+ {% endif %} + {% if show.cba_series_id %} + CBA-Link: CBA
+ {% endif %}

{% if show.notes.all %} -
-

Sendungstipps

- - {% endif %} +
+

Sendungstipps

+ + {% endif %}
diff --git a/program/templates/show_list.html b/program/templates/show_list.html index 167a470..136930d 100644 --- a/program/templates/show_list.html +++ b/program/templates/show_list.html @@ -6,48 +6,51 @@ {% load content_boxes %}
-{% broadcastformat %} + {% broadcastformat %}
-
-
Filter
-
-{% musicfocus %} -{% showinformation %} -{% showtopic %} +
+
Filter
+
+ {% musicfocus %} + {% showinformation %} + {% showtopic %}
-

Sendungen A-Z

+

Sendungen A-Z

-
- {% for show in show_list %} -
-
- {% for item in show.showinformation.all %} - {{ item.abbrev }} +
+ {% for show in show_list %} +
+
+ {% for item in show.showinformation.all %} + {{ item.abbrev }} + {% endfor %} + {% for item in show.showtopic.all %} + {{ item.abbrev }} + {% endfor %} + {% for item in show.musicfocus.all %} + {{ item.abbrev }} + {% endfor %} +
+
+

{{ show.name }}

+
    + {% for slot in show.programslots.all %} + {% if slot.has_active_timeslot %} +
  • {{ slot }}
  • + {% endif %} + {% endfor %} +
+

{{ show.short_description }}

+
+
{% endfor %} - {% for item in show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} -
-
-

{{ show.name }}

-
    - {% for slot in show.programslots.all %} - {% if slot.has_active_timeslot %} -
  • {{ slot }}
  • - {% endif %} - {% endfor %} -
-

{{ show.short_description }}

-
- {% endfor %} -
diff --git a/program/templates/styles.css b/program/templates/styles.css index 2934a7f..395be34 100644 --- a/program/templates/styles.css +++ b/program/templates/styles.css @@ -6,10 +6,12 @@ .mf-{{ mf.abbrev }} { background-image:url({{ mf.button_url }}); } .filterbox .mf-{{ mf.abbrev }}:hover { background-image:url({{ mf.button_hover_url }}); } {% endfor %} + {% for si in showinformation %} .si-{{ si.abbrev }} { background-image:url({{ si.button_url }}); } .filterbox .si-{{ si.abbrev }}:hover { background-image:url({{ si.button_hover_url }}); } {% endfor %} + {% for st in showtopic %} .st-{{ st.abbrev }} { background-image:url({{ st.button_url }}); } .filterbox .st-{{ st.abbrev }}:hover { background-image:url({{ st.button_hover_url }}); } @@ -18,9 +20,11 @@ {% for mf in musicfocus %} .show-detail-header .mf-{{ mf.abbrev }} { background-image:url({{ mf.big_button_url }}); } {% endfor %} + {% for si in showinformation %} .show-detail-header .si-{{ si.abbrev }} { background-image:url({{ si.big_button_url }}); } {% endfor %} + {% for st in showtopic %} .show-detail-header .st-{{ st.abbrev }} { background-image:url({{ st.big_button_url }}); } {% endfor %} diff --git a/program/templates/timeslot_detail.html b/program/templates/timeslot_detail.html index 856aef3..c899c32 100644 --- a/program/templates/timeslot_detail.html +++ b/program/templates/timeslot_detail.html @@ -6,53 +6,53 @@
-
-

- {{ timeslot.show.name }} -

- {% if timeslot.note %} -

{{ timeslot.note.title }}

- {% endif %} - Sendung am {{ timeslot.start|date:"d.m. H:i" }} bis {{ timeslot.end|date:"H:i" }} - -
- {% for item in timeslot.show.showinformation.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in timeslot.show.showtopic.all %} - {{ item.abbrev }} - {% endfor %} - {% for item in timeslot.show.musicfocus.all %} - {{ item.abbrev }} - {% endfor %} -
- -

{{ timeslot.show.broadcastformat.format }}

+
+

+ {{ timeslot.show.name }} +

+ {% if timeslot.note %} +

{{ timeslot.note.title }}

+ {% endif %} + Sendung am {{ timeslot.start|date:"d.m. H:i" }} bis {{ timeslot.end|date:"H:i" }} + +
+ {% for si in timeslot.show.showinformation.all %} + {{ si.abbrev }} + {% endfor %} + {% for st in timeslot.show.showtopic.all %} + {{ st.abbrev }} + {% endfor %} + {% for mf in timeslot.show.musicfocus.all %} + {{ mf.abbrev }} + {% endfor %} +
+ +

{{ timeslot.show.broadcastformat.format }}

{% if timeslot.note %} -

{{ timeslot.note.content|safe }}

+

{{ timeslot.note.content|safe }}

{% endif %}
{{ timeslot.show.short_description }}
{% if timeslot.show.description %} -
{{ timeslot.show.description|safe }}
+
{{ timeslot.show.description|safe }}
{% endif %}

- {% for host in timeslot.show.hosts.all %} - {{ host }}
- {% endfor %} - {% if timeslot.show.email %} - Email: {{ timeslot.show.email }}
- {% endif %} - {% if timeslot.show.website %} - Website: {{ timeslot.show.website }}
- {% endif %} - {% if timeslot.show.cba_series_id %} - CBA-Link: CBA
- {% endif %} + {% for host in timeslot.show.hosts.all %} + {{ host }}
+ {% endfor %} + {% if timeslot.show.email %} + Email: {{ timeslot.show.email }}
+ {% endif %} + {% if timeslot.show.website %} + Website: {{ timeslot.show.website }}
+ {% endif %} + {% if timeslot.show.cba_series_id %} + CBA-Link: CBA
+ {% endif %}

diff --git a/program/templates/week_schedule.html b/program/templates/week_schedule.html index a10a4c1..ad6b012 100644 --- a/program/templates/week_schedule.html +++ b/program/templates/week_schedule.html @@ -6,17 +6,17 @@
- - - - - - - - - - -
<--{{ cur_w }}{{ next_w1 }}{{ next_w2 }}{{ next_w3 }}{{ next_w4 }}-->
+ + + + + + + + + + +
<--{{ cur_w }}{{ next_w1 }}{{ next_w2 }}{{ next_w3 }}{{ next_w4 }}-->
 
06:00
@@ -119,8 +119,8 @@
03:00
04:00
05:00
-
- +
+
diff --git a/program/templates/week_schedule_timeslot.html b/program/templates/week_schedule_timeslot.html index 852466b..8942327 100644 --- a/program/templates/week_schedule_timeslot.html +++ b/program/templates/week_schedule_timeslot.html @@ -1,54 +1,54 @@ {% load timeslots %} {% if forloop.first and timeslot.start != timeslot.get_previous_by_start.end %} -
-
{{ default_show.name }}
-
+
+
{{ default_show.name }}
+
{% endif %} {% if forloop.first and timeslot.start == timeslot.get_next_by_start.end and timeslot.start != "06:00" %} - + {% endif %} {% if forloop.first and timeslot.start != "06:00" and timeslot.show == default_show %} - + {% endif %} {% if forloop.first and timeslot.start != "06:00" and timeslot.show != default_show %} - + {% endif %} {% if not forloop.first and not forloop.last %} - - {% if timeslot.end != timeslot.get_next_by_start.start %} -
-
{{ default_show.name }}
+ + {% if timeslot.end != timeslot.get_next_by_start.start %} +
+
{{ default_show.name }}
+
{% endif %} {% endif %} {% if forloop.last and timeslot.end != "06:00" and timeslot.show == default_show %} - + {% endif %} {% if forloop.last and timeslot.end != "06:00" and timeslot.show != default_show %} - + {% endif %} {% if forloop.last and timeslot.end != timeslot.get_next_by_start.start %} -
-
{{ default_show.name }}
-
-{% endif %} +
+
{{ default_show.name }}
+
+{% endif %} diff --git a/program/templatetags/content_boxes.py b/program/templatetags/content_boxes.py index 6e2b6c7..7f176c6 100644 --- a/program/templatetags/content_boxes.py +++ b/program/templatetags/content_boxes.py @@ -8,23 +8,19 @@ from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTop @register.inclusion_tag('boxes/broadcastformat.html') def broadcastformat(): - broadcastformats = BroadcastFormat.objects.filter(enabled=True) - return {'broadcastformats': broadcastformats} + return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)} @register.inclusion_tag('boxes/musicfocus.html') def musicfocus(): - musicfoci = MusicFocus.objects.all() - return {'musicfoci': musicfoci} + return {'musicfocus_list': MusicFocus.objects.all()} @register.inclusion_tag('boxes/showinformation.html') def showinformation(): - showinformations = ShowInformation.objects.all() - return {'showinformations': showinformations} + return {'showinformation_list': ShowInformation.objects.all()} @register.inclusion_tag('boxes/showtopic.html') def showtopic(): - showtopics = ShowTopic.objects.all() - return {'showtopics': showtopics} + return {'showtopic_list': ShowTopic.objects.all()} -- cgit v0.10.2