summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--program/admin.py16
-rw-r--r--program/models.py4
-rw-r--r--program/urls.py4
-rw-r--r--templates/program/show_detail.html7
-rw-r--r--templates/program/timeslot_detail.html2
6 files changed, 14 insertions, 21 deletions
diff --git a/TODO b/TODO
index 9b3c626..e69de29 100644
--- a/TODO
+++ b/TODO
@@ -1,2 +0,0 @@
-* integrate open ID
-* integrate Disqus
diff --git a/program/admin.py b/program/admin.py
index 63fc2e2..9c744e3 100644
--- a/program/admin.py
+++ b/program/admin.py
@@ -24,25 +24,17 @@ class NoteAdmin(admin.ModelAdmin):
date_hierarchy = 'start'
exclude = ('owner',)
list_display = ('title', 'show', 'start', 'status')
- list_filter = ('status', 'show')
+ list_filter = ('status',)
ordering = ('timeslot',)
def queryset(self, request):
- qs = super(NoteAdmin, self).queryset(request)
-
- if request.user.is_superuser:
- return qs
- else:
- return qs.filter(owner=request.user)
+ return super(NoteAdmin, self).queryset(request).filter(owner=request.user)
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'timeslot':
one_year_ago = datetime.today() - timedelta(days=365)
- if request.user.is_superuser:
- kwargs['queryset'] = TimeSlot.objects.filter(start__gt=one_year_ago, note__isnull=True)
- else:
- shows = request.user.shows.all()
- kwargs['queryset'] = TimeSlot.objects.filter(show__in=shows, start__gt=one_year_ago, note__isnull=True)
+ shows = request.user.shows.all()
+ kwargs['queryset'] = TimeSlot.objects.filter(show__in=shows, start__gt=one_year_ago)
return super(NoteAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
diff --git a/program/models.py b/program/models.py
index a63fcc7..8f2e50b 100644
--- a/program/models.py
+++ b/program/models.py
@@ -262,7 +262,7 @@ class TimeSlot(models.Model):
programslot = models.ForeignKey(ProgramSlot, related_name='timeslots', verbose_name=_("Program slot"))
start = models.DateTimeField(_("Start time"), unique=True)
end = models.DateTimeField(_("End time"))
- show = models.ForeignKey(Show, editable=False)
+ show = models.ForeignKey(Show, editable=False, related_name='timeslots')
objects = TimeSlotManager()
@@ -298,7 +298,7 @@ class Note(models.Model):
status = models.IntegerField(_("Status"), choices=STATUS_CHOICES, default=1)
cba_entry_id = models.IntegerField(_("CBA entry ID"), blank=True, null=True)
start = models.DateTimeField(editable=False)
- show = models.ForeignKey(Show, editable=False)
+ show = models.ForeignKey(Show, editable=False, related_name='notes')
created = models.DateTimeField(auto_now_add=True, editable=False)
last_updated = models.DateTimeField(auto_now=True, editable=False)
diff --git a/program/urls.py b/program/urls.py
index 60d81a7..7176382 100644
--- a/program/urls.py
+++ b/program/urls.py
@@ -5,9 +5,6 @@ from django.views.generic.list_detail import object_detail, object_list
from models import Host, Show, TimeSlot
from views import current_show, day_schedule, recommendations, show_list, week_schedule
-import os
-PROGRAM_STATIC_DIR = os.path.join(os.path.dirname(__file__), '../site_media')
-
hosts_dict = {
'queryset': Host.objects.all(),
'template_object_name': 'host'
@@ -35,5 +32,4 @@ urlpatterns = patterns('',
url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, shows_dict, name='show-detail'),
url(r'^(?P<object_id>\d+)/?$', object_detail, timeslots_dict, name='timeslot-detail'),
url(r'^week/?$', week_schedule),
- url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': PROGRAM_STATIC_DIR}),
)
diff --git a/templates/program/show_detail.html b/templates/program/show_detail.html
index 443a64a..ae1690a 100644
--- a/templates/program/show_detail.html
+++ b/templates/program/show_detail.html
@@ -11,11 +11,13 @@
<div class="show-detail-header bf-{{show.broadcastformat.slug}}">
<div class="show-details">
<h1 id="name">{{ show.name }}</h1>
+ {% if show.id != 1 %}
<p id="programslots">
{% for slot in show.programslots.all %}
<span class="programslot">{{ slot }}</span><br />
{% endfor %}
</p>
+ {% endif %}
</div>
<div class="show-categorization">
@@ -54,6 +56,11 @@
{% endif %}
</p>
+ <p>
+ {% for note in show.notes.all %}
+ <a href="{% url timeslot-detail note.timeslot.id %}" title="{{ note.title }}">{{ note.start|date:"d. M Y" }}</a>
+ {% endfor %}
+ </p>
</div>
</body>
diff --git a/templates/program/timeslot_detail.html b/templates/program/timeslot_detail.html
index 7955451..8b08f8b 100644
--- a/templates/program/timeslot_detail.html
+++ b/templates/program/timeslot_detail.html
@@ -7,7 +7,7 @@
<div id="content-main" class="timeslot-detail">
<div class="show-detail-header bf-{{timeslot.show.broadcastformat.slug}}">
- <h1 id="name">{{ timeslot.show.name }}</h1>
+ <h1 id="name"><a href="{% url show-detail timeslot.show.slug %}">{{ timeslot.show.name }}</a></h1>
<div class="show-abbrevs">
{% for item in timeslot.show.showinformation.all %}