productions

This commit is contained in:
Sanjay B 2013-08-12 16:25:30 +05:30
parent a6ca7d815c
commit 35f512353b
2 changed files with 60 additions and 18 deletions

View File

@ -449,9 +449,13 @@ class Production(ItfModel):
def get_dict(self): def get_dict(self):
from events.models import Event
rel_level1 = [obj for obj in Production.objects.filter(script=self.script)] 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())) 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 { return {
'name': self.name, 'name': self.name,
'anecdotes': self.anecdotes, 'anecdotes': self.anecdotes,
@ -463,6 +467,7 @@ class Production(ItfModel):
'awards': [ obj for obj in self.awards.all()], 'awards': [ obj for obj in self.awards.all()],
'languages': [ obj for obj in self.languages.all()], 'languages': [ obj for obj in self.languages.all()],
'debut_date':self.debut_date, 'debut_date':self.debut_date,
'last_date': last_date,
'sibling_productions': rel_level1, 'sibling_productions': rel_level1,
'related_productions' : rel_level2, 'related_productions' : rel_level2,
'people': self.get_people() 'people': self.get_people()

View File

@ -58,46 +58,81 @@ $(function() {
<h3 class="borderYellow paddingBottom">{{ name }}</h3> <h3 class="borderYellow paddingBottom">{{ name }}</h3>
{% if group %} <div class="paddingTop"><strong>Group: </strong>{{ group.name }}</div> {% endif %} {% if group %} <div class="paddingTop"><strong>Group: </strong>{{ group.name }}</div> {% endif %}
<div><strong>Languages: </strong>Hindi, English, etc.</div> {% if languages %}
<div>From 2011 to 2013</div> <div><strong>Languages: </strong>
<div><strong>No of Shows: </strong>range/number</div> {% for language in languages %}
{{ language.name }}
{% endfor %}
</div>
{% endif %}
<div>From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }} </div>
{% comment %}
<div><strong>No of Shows: </strong> </div>
<div class="borderYellow"> <a href="" class="toggleLink rightFloat">Book Now>></a> <div class="borderYellow"> <a href="" class="toggleLink rightFloat">Book Now>></a>
<br /><br /> <br /><br />
{% endcomment %}
</div> </div>
<br /> <br />
<div><strong>Writers: </strong> Name (playwright), name (adaptation), name (translation)</div> {% if playwright %}
<div><strong>Director: </strong>Hindi, English, etc.</div> <div><strong>Writer: </strong>
<div><strong>Credits: name (research), name (music)</strong></div> <a href="{{ playwright.get_absolute_url }}" target="_blank">
{{ playwright }}
</a>
</div>
{% endif %}
{% if director %}
<div><strong>Director: </strong>
{% if director %}
<a href="{{ director.get_absolute_url }}" target="_blank">
{{ director }}
</a>
{% endif %}
</div>
<!-- <div><strong>Credits: name (research), name (music)</strong></div> -->
<div class="borderYellow"> <a href="" class="toggleLink rightFloat">See full credits>></a><br /><br /></div> <div class="borderYellow"> <a href="" class="toggleLink rightFloat">See full credits>></a><br /><br /></div>
<br /> <br />
<div> <div>
<p>Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph. <p>
Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph.</p> {{ synopsis|linebreaksbr }}
</p>
</div> </div>
<div class="borderYellow"> <div class="borderYellow">
<a href="">Contact</a> <!-- <a href="">Contact</a> -->
<div>Group website</div> {% if group.website %}
<div>Group website: <a href="{{ group.website }}" target="_blank">{{ group.website }}</a> </div>
{% endif %}
<br /> <br />
</div> </div>
<br /> <br />
{% if awards %}
<div class="borderYellow"> <div class="borderYellow">
<h5 class="orangeInnerRight">Awards</h5> <h5 class="orangeInnerRight">Awards</h5>
<div>Name of award, name of awardee, year, link</div> {% for award in awards %}
<div>Name of award, name of awardee, year, link</div> <div>
<div>Name of award, name of awardee, year, link</div> {{ award.title }}
<div>Name of award, name of awardee, year, link</div> {% if award.year %},
{{ award.year }}
{% endif %}
{% if award.link %},
<a href="{{ award.link }}" target="_blank">link</a>
{% endif %}
</div>
{% endfor %}
<br /> <br />
</div> </div>
{% endif %}
<br /> <br />
<!--
<h5 class="orangeInnerRight">Links</h5> <h5 class="orangeInnerRight">Links</h5>
<a href="">Link to article</a> <a href="">Link to article</a>
<div>One line desc</div> <div>One line desc</div>
@ -108,6 +143,7 @@ $(function() {
<a href="">Link to article</a> <a href="">Link to article</a>
<div>One line desc</div> <div>One line desc</div>
<br /> <br />
-->
</div> <!-- end about --> </div> <!-- end about -->
<div id="cast" class="tab_content"> <div id="cast" class="tab_content">
@ -115,13 +151,14 @@ $(function() {
<div id="gallery" class="tab_content"> <div id="gallery" class="tab_content">
{% include 'includes/media_gallery.html' %} {% include 'includes/media_gallery.html' %}
<!--
<h3 class="orange">Links</h3> <h3 class="orange">Links</h3>
<div><a href="">Link</a></div> <div><a href="">Link</a></div>
<div><a href="">Link</a></div> <div><a href="">Link</a></div>
<div><a href="">Link</a></div> <div><a href="">Link</a></div>
<div><a href="">Link</a></div> <div><a href="">Link</a></div>
<a href="" class="rightFloat">More>></a> <a href="" class="rightFloat">More>></a>
-->
</div> <!-- end gallery --> </div> <!-- end gallery -->
<div id="buzz" class="tab_content"> <div id="buzz" class="tab_content">