From 3a19473a4bc9e2fa241422c617b5c5d0b4bbc254 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Tue, 13 Aug 2013 12:08:47 +0530 Subject: [PATCH] add shows to productions --- itf/itfprofiles/models.py | 5 +- .../modules/itfprofiles/production.html | 115 +++++------------- 2 files changed, 32 insertions(+), 88 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index b08f4c7..c456a53 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -452,10 +452,10 @@ class Production(ItfModel): from events.models import Event rel_level1 = [obj for obj in Production.objects.filter(script=self.script)] rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all())) - shows = Event.objects.filter(production=self) + shows = Event.objects.filter(production=self).order_by('-start_date') last_date = None if shows.count() > 0: - last_date = shows.order_by('-start_date')[0].start_date + last_date = shows[0].start_date return { 'name': self.name, 'anecdotes': self.anecdotes, @@ -465,6 +465,7 @@ class Production(ItfModel): 'script': self.script, 'synopsis': self.synopsis, 'awards': [ obj for obj in self.awards.all()], + 'shows': shows, 'languages': [ obj for obj in self.languages.all()], 'debut_date':self.debut_date, 'last_date': last_date, diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index d74d521..14b481c 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -10,7 +10,7 @@ $(function() { +{% if shows %}

{{ name }}

- (to be implemented) - - - - - - - - - - - - - - - - - - - - - - - - + {% for show in shows %} + + + + + + + + + {% endfor %}
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
+ {{ show.start_date|date:"d M, Y" }} + + {{ show.start_time|time:"P" }} + + {{ show.city.name }} + + {% if show.booking_link %} + Book now + {% else %} + More details + {% endif %} +
-More>> +
+{% endif %}
@@ -65,14 +64,14 @@ $(function() { {% endfor %}
{% endif %} -
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }}
+
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }} {% endif %}
{% comment %}
No of Shows:
Book Now>>

- {% endcomment %}
+ {% endcomment %}
{% if playwright %} @@ -84,12 +83,11 @@ $(function() { {% endif %} {% if director %}
Director: - {% if director %} {{ director }} - {% endif %}
+ {% endif %}
See full credits>>

@@ -132,18 +130,6 @@ $(function() { {% endif %}
-
@@ -151,30 +137,11 @@ $(function() {
{% include 'includes/buzzitems.html' %} -
{% load comments %} @@ -218,30 +185,6 @@ $(function() {
{% endif %} - - - - - - - - - - - - - - - - - - - - - - -