plug-in related scripts, etc. into templates

This commit is contained in:
Sanj 2013-01-03 06:40:17 +05:30
parent 77573f8252
commit 780d883e04
5 changed files with 43 additions and 109 deletions

View File

@ -101,7 +101,8 @@ class Person(ItfModel):
'languages': [ obj for obj in self.languages.all()],
'awards': [ obj for obj in self.awards.all()],
'buzzitems': [ obj for obj in self.buzzitems.all()],
'resources': self.resources.all()
'resources': self.resources.all(),
'related_scripts': self.related_scripts()
}
def related_scripts(self):
@ -354,6 +355,7 @@ class TheatreGroup(ItfModel):
'productions': [obj for obj in self.production_set.all() ],
'scripts': [obj for obj in self.script_set.all() ],
'people' : [obj for obj in self.persongroup_set.all() ],
'worked_with_people': self.worked_with_people()
}
def worked_with_people(self):
@ -438,7 +440,8 @@ class Production(ItfModel):
'languages': [ obj for obj in self.languages.all()],
'debut_date':self.debut_date,
'sibling_productions': rel_level1,
'related_productions' : rel_level2,
'related_productions' : rel_level2,
'people': self.get_people()
}

View File

@ -87,7 +87,8 @@ class Script(ItfModel):
'license_adapt': self.license_adapt,
'license_perform': self.license_perform,
'productions': self.production_set.all(),
'related_scripts': self.related_scripts
'related_scripts': self.related_scripts,
'related_people': self.related_people()
}
def related_people(self):

View File

@ -102,17 +102,11 @@
<div id="scripts" class="tab_content">
<div>Help text - to send them to script archive</div>
<br />
<a href="toggleLink">Title</a>
<div>One line description. <span class="toggleDiv">Extra information goes here</span></div>
<br />
<a href="toggleLink">Title</a>
<div>One line description. <span class="toggleDiv">Extra information goes here</span></div>
<br />
<a href="toggleLink">Title</a>
<div>One line description. <span class="toggleDiv">Extra information goes here</span></div>
{% for script in related_scripts %}
<a href="{{ script.get_absolute_url }}">{{ script.title }}</a>
<div>{{ script.synopsis }} <!-- <span class="toggleDiv">Extra information goes here</span> --></div>
<br />
{% endfor %}
</div> <!-- end scripts -->

View File

@ -107,9 +107,11 @@
<div class="clear"></div>
<h5 class="orangeInnerRight">Worked with (not implemented)</h5>
{% if worked_with_people %}
<h5 class="orangeInnerRight">Worked with</h5>
<br />
{% for p in worked_with_people %}
<div class="productionEach">
<div class="productionEachImg">
@ -117,58 +119,17 @@
</div>
<div class="productionEachTextA">
<a href="">Name of Group</a>
<div>Location</div>
<div>Relationship to Group (e.g. admin)</div>
<a href="{{ p.person.get_absolute_url }}">{{ p.person.first_name }} {{ p.person.last_name }}</a>
<div>{{ p.role }}: {{ p.name }}</div>
<!-- <div></div> -->
</div>
<div class="clear"></div>
</div> <!-- end production each -->
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Occupation/one-line desc</div>
<div>Location</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Occupation/one-line desc</div>
<div>Location</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Location</div>
<div>Relationship to Group (e.g. admin)</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
{% endfor %}
<a href="" class="toggleLink rightFloat">More>></a>
<!-- <a href="" class="toggleLink rightFloat">More>></a> -->
<div class="clear"></div>

View File

@ -13,7 +13,7 @@ $(function() {
<ul class="tabsInnerRight">
<li><a href="#about">About</a></li>
<li><a href="#productions">Productions</a></li>
<li><a href="#people">People</a></li>
{% if related_people %}<li><a href="#people">People</a></li>{% endif %}
<li><a href="#notes">Notes</a></li>
{% if obj.galleries.count %} <li><a href="#gallery">Gallery</a></li> {% endif %}
{% if resources %}<li><a href="#resources">Resources</a></li>{% endif %}
@ -23,7 +23,7 @@ $(function() {
<h3>{{ title }}</h3>
{% if author %}
<div><strong>Writer:</strong> {{ author.first_name }} {{ author.last_name }}</div>
<div><strong>Writer:</strong> {{ author }}</div>
{% endif %}
{% if language %}
<div><strong>Language:</strong> {{ language }}</div>
@ -77,8 +77,9 @@ $(function() {
<div id="productions" class="tab_content">
<h3 class="orange">Productions</h3>
{% if sibling_productions %}
{% for p in sibling_productions %}
<div class="productionEach">
<div class="productionEachImg">
@ -107,9 +108,15 @@ $(function() {
</div> <!-- end production each -->
{% endfor %}
{% else %}
<p>No productions for this script.</p>
{% endif %}
<h3 class="orange">Related Productions</h3>
{% if related_productions %}
{% for p in related_productions %}
<div class="productionEach">
@ -139,67 +146,35 @@ $(function() {
</div> <!-- end production each -->
{% endfor %}
{% else %}
<p>No related productions</p>
{% endif %}
</div> <!-- end productions -->
{% if related_people %}
<div id="people" class="tab_content">
(to be implemented)
{% for r in related_people %}
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Writer: Some script</div>
<div>Translation of script by playwright</div>
<div>From language to language</div>
<a href="{{ r.person.get_absolute_url }}">{{ r.person.first_name }} {{ r.person.last_name }}</a>
<div>{{ r.role }}: {{ r.name }}</div>
<!-- <a href="" class="toggleLink orange">Synopsis</a>-->
<div class="toggleDiv">Lorem ipsum</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Writer: Some script</div>
<div>Translation of script by playwright</div>
<div>From language to language</div>
<!-- <a href="" class="toggleLink orange">Synopsis</a>-->
<div class="toggleDiv">Lorem ipsum</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
<div class="productionEach">
<div class="productionEachImg">
<img src="" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="">Name of Person</a>
<div>Writer: Some script</div>
<div>Translation of script by playwright</div>
<div>From language to language</div>
<!-- <a href="" class="toggleLink orange">Synopsis</a>-->
<div class="toggleDiv">Lorem ipsum</div>
<!-- <div class="toggleDiv">Lorem ipsum</div> -->
</div>
<div class="clear"></div>
</div> <!-- end production each -->
{% endfor %}
</div> <!-- end people -->
{% endif %}
<div id="notes" class="tab_content">