From 35f512353b673912233bc568fc0f1c0cf8657ad5 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 12 Aug 2013 16:25:30 +0530 Subject: [PATCH] productions --- itf/itfprofiles/models.py | 7 +- .../modules/itfprofiles/production.html | 71 ++++++++++++++----- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 57ad7d9..b08f4c7 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -449,9 +449,13 @@ class Production(ItfModel): def get_dict(self): + 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) + last_date = None + if shows.count() > 0: + last_date = shows.order_by('-start_date')[0].start_date return { 'name': self.name, 'anecdotes': self.anecdotes, @@ -463,6 +467,7 @@ class Production(ItfModel): 'awards': [ obj for obj in self.awards.all()], 'languages': [ obj for obj in self.languages.all()], 'debut_date':self.debut_date, + 'last_date': last_date, 'sibling_productions': rel_level1, 'related_productions' : rel_level2, 'people': self.get_people() diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index 10e6ec3..d74d521 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -58,46 +58,81 @@ $(function() {

{{ name }}

{% if group %}
Group: {{ group.name }}
{% endif %} -
Languages: Hindi, English, etc.
-
From 2011 to 2013
-
No of Shows: range/number
+ {% if languages %} +
Languages: + {% for language in languages %} + {{ language.name }} + {% endfor %} +
+ {% endif %} +
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }}
+ {% comment %} +
No of Shows:
Book Now>>

+ {% endcomment %}

-
Writers: Name (playwright), name (adaptation), name (translation)
-
Director: Hindi, English, etc.
-
Credits: name (research), name (music)
+ {% if playwright %} +
Writer: + + {{ playwright }} + +
+ {% endif %} + {% if director %} +
Director: + {% if director %} + + {{ director }} + + {% endif %} +
+
See full credits>>


-

Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph. - Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph.

+

+ {{ synopsis|linebreaksbr }} +

- Contact -
Group website
+ + {% if group.website %} +
Group website: {{ group.website }}
+ {% endif %}

- + {% if awards %}
Awards
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
+ {% for award in awards %} +
+ {{ award.title }} + {% if award.year %}, + {{ award.year }} + {% endif %} + {% if award.link %}, + link + {% endif %} + +
+ {% endfor %} + +
+ {% endif %}
- +
@@ -115,13 +151,14 @@ $(function() {