Skip to content
Snippets Groups Projects
Commit bfcdf06f authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

added always_visible to the Hosts and updated template and URLs

parent f2c4d866
Branches
Tags
No related merge requests found
......@@ -219,6 +219,7 @@ class MusicFocus(models.Model):
class Host(models.Model):
name = models.CharField(_("Name"), max_length=128)
always_visible = models.BooleanField(_("Always visible"), default=False)
email = models.EmailField(_("E-Mail"), blank=True)
website = models.URLField(_("Website"), blank=True)
......
......@@ -11,7 +11,11 @@
<div id="shows-title">Sendungen</div>
{% for show in host.shows.all %}
{% if show.has_active_programslots %}
<div class="show {{ show.broadcastformat.slug }}"><a href="{% url show-detail show.slug %}">{{ show }}</a></div>
{% else %}
<div class="show {{ show.broadcastformat.slug }}">{{ show }}</div>
{% endif %}
{% endfor %}
</div>
......
from django.conf import settings
from django.conf.urls.defaults import *
from django.db.models import Q
from django.views.decorators.cache import cache_page
from django.views.generic.list_detail import object_detail, object_list
......@@ -11,7 +12,8 @@ from datetime import date
hosts_dict = {
'queryset': Host.objects.filter(
shows__programslots__until__gte=date.today()).distinct(),
Q(shows__programslots__until__gte=date.today()) |
Q(always_visible=True)).distinct(),
'template_object_name': 'host'
}
shows_dict = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment