diff options
author | Christian Pointner <equinox@helsinki.at> | 2021-03-10 21:09:33 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2021-03-10 21:09:33 (GMT) |
commit | 149eff999483b0b7e22d81b089c0da6b34024525 (patch) | |
tree | 3ade4c8e81453106b508f8b52a18937b0c4cd36d /program | |
parent | b63d197f2d77ea679f2cf8b28b91b9bafa387e2c (diff) |
add extra div for host-detail in V2 template and fix join without distinct in host model
Diffstat (limited to 'program')
-rw-r--r-- | program/models.py | 2 | ||||
-rw-r--r-- | program/templates/v2/host_detail.html | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/program/models.py b/program/models.py index 7951c35..b5123cb 100644 --- a/program/models.py +++ b/program/models.py @@ -240,7 +240,7 @@ class Host(models.Model): return reverse('host-detail', args=[str(self.id)]) def active_shows(self): - return self.shows.filter(programslots__until__gt=datetime.today) + return self.shows.filter(programslots__until__gt=datetime.today).distinct() class Show(models.Model): diff --git a/program/templates/v2/host_detail.html b/program/templates/v2/host_detail.html index 0dff882..f5cac4d 100644 --- a/program/templates/v2/host_detail.html +++ b/program/templates/v2/host_detail.html @@ -7,18 +7,20 @@ <div id="content-main" class="host-detail"> <h1>{{ host.name }}</h1> - <div id="shows"> - <div id="shows-title">Sendungen</div> + <div class="host"> + <div id="shows"> + <div id="shows-title">Sendungen</div> {% for show in host.active_shows %} - <div class="show bf-{{ show.broadcastformat.slug }}"><a href="/program/shows/{{ show.slug }}"> {{ show.name }}</a></div> + <div class="show bf-{{ show.broadcastformat.slug }}"><a href="/program/shows/{{ show.slug }}"> {{ show.name }}</a></div> {% endfor %} - </div> + </div> {% if host.email %} - <div id="email">E-Mail Adresse: <a href="{{ host.email }}">{{ host.email }}</a></div> + <div id="email">E-Mail Adresse: <a href="{{ host.email }}">{{ host.email }}</a></div> {% endif %} {% if host.website %} - <div id="website">Website: <a href="{{ host.website }}">{{ host.website }}</a></div> + <div id="website">Website: <a href="{{ host.website }}">{{ host.website }}</a></div> {% endif %} + </div> </div> </body> |