From 149eff999483b0b7e22d81b089c0da6b34024525 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Wed, 10 Mar 2021 22:09:33 +0100
Subject: add extra div for host-detail in V2 template and fix join without
 distinct in host model


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>
-- 
cgit v0.10.2