add shows to productions
This commit is contained in:
parent
40aa62f687
commit
3a19473a4b
|
@ -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,
|
||||
|
|
|
@ -10,7 +10,7 @@ $(function() {
|
|||
</script>
|
||||
|
||||
<ul class="tabsInnerRight">
|
||||
<li><a href="#calendar">Calendar</a></li>
|
||||
{% if shows %}<li><a href="#calendar">Calendar</a></li>{% endif %}
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#cast">Cast and Crew</a></li>
|
||||
<li><a href="#gallery">Gallery</a></li>
|
||||
|
@ -18,40 +18,39 @@ $(function() {
|
|||
<li><a href="#notes">Notes</a></li>
|
||||
</ul>
|
||||
|
||||
{% if shows %}
|
||||
<div id="calendar" class="tab_content">
|
||||
<h3>{{ name }}</h3>
|
||||
|
||||
(to be implemented)
|
||||
<table width="520" border="1" cellspacing="0" cellpadding="0" class="tableCalendar">
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>Time</td>
|
||||
<td>Venue, City</td>
|
||||
<td class="orangeNoBold">Book Now/Full</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>Time</td>
|
||||
<td>Venue, City</td>
|
||||
<td class="orangeNoBold">Book Now/Full</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>Time</td>
|
||||
<td>Venue, City</td>
|
||||
<td class="orangeNoBold">Book Now/Full</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>Time</td>
|
||||
<td>Venue, City</td>
|
||||
<td class="orangeNoBold">Book Now/Full</td>
|
||||
</tr>
|
||||
{% for show in shows %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ show.start_date|date:"d M, Y" }}
|
||||
</td>
|
||||
<td>
|
||||
{{ show.start_time|time:"P" }}
|
||||
</td>
|
||||
<td>
|
||||
{{ show.city.name }}
|
||||
</td>
|
||||
<td>
|
||||
{% if show.booking_link %}
|
||||
<a href="{{ show.booking_link }}" target="_blank">Book now</a>
|
||||
{% else %}
|
||||
<a href="{{ show.get_absolute_url }}" target="_blank">More details</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<a href="" class="toggleLink rightFloat">More>></a>
|
||||
<!-- <a href="" class="toggleLink rightFloat">More>></a> -->
|
||||
|
||||
</div> <!-- end div calendar -->
|
||||
{% endif %}
|
||||
|
||||
<div id="about" class="tab_content">
|
||||
|
||||
|
@ -65,14 +64,14 @@ $(function() {
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }} </div>
|
||||
<div>From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }} {% endif %}</div>
|
||||
{% comment %}
|
||||
<div><strong>No of Shows: </strong> </div>
|
||||
<div class="borderYellow"> <a href="" class="toggleLink rightFloat">Book Now>></a>
|
||||
<br /><br />
|
||||
{% endcomment %}
|
||||
</div>
|
||||
|
||||
{% endcomment %}
|
||||
<br />
|
||||
|
||||
{% if playwright %}
|
||||
|
@ -84,12 +83,11 @@ $(function() {
|
|||
{% endif %}
|
||||
{% if director %}
|
||||
<div><strong>Director: </strong>
|
||||
{% if director %}
|
||||
<a href="{{ director.get_absolute_url }}" target="_blank">
|
||||
{{ director }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- <div><strong>Credits: name (research), name (music)</strong></div> -->
|
||||
<div class="borderYellow"> <a href="" class="toggleLink rightFloat">See full credits>></a><br /><br /></div>
|
||||
|
||||
|
@ -132,18 +130,6 @@ $(function() {
|
|||
{% endif %}
|
||||
|
||||
<br />
|
||||
<!--
|
||||
<h5 class="orangeInnerRight">Links</h5>
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
-->
|
||||
</div> <!-- end about -->
|
||||
|
||||
<div id="cast" class="tab_content">
|
||||
|
@ -151,30 +137,11 @@ $(function() {
|
|||
|
||||
<div id="gallery" class="tab_content">
|
||||
{% include 'includes/media_gallery.html' %}
|
||||
<!--
|
||||
<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>
|
||||
<a href="" class="rightFloat">More>></a>
|
||||
-->
|
||||
</div> <!-- end gallery -->
|
||||
|
||||
<div id="buzz" class="tab_content">
|
||||
|
||||
{% include 'includes/buzzitems.html' %}
|
||||
<!-- <h3 class="orangeInnerRight">Reviews</h3>
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
<a href="">Link to article</a>
|
||||
<div>One line desc</div>
|
||||
<br />
|
||||
<a href="" class="rightFloat">More>></a> -->
|
||||
<br />
|
||||
|
||||
{% load comments %}
|
||||
|
@ -218,30 +185,6 @@ $(function() {
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- <div class="borderYellow">-->
|
||||
<!-- <div>Comments Comments Comments Comments Comments Comments</div>-->
|
||||
<!-- <div class="rightFloat">-Posted by date, time</div>-->
|
||||
<!-- <br /><br />-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="borderYellow">-->
|
||||
<!-- <br />-->
|
||||
<!-- <div>Comments Comments Comments Comments Comments Comments</div>-->
|
||||
<!-- <div class="rightFloat">-Posted by date, time</div>-->
|
||||
<!-- <br /><br />-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="borderYellow">-->
|
||||
<!-- <br />-->
|
||||
<!-- <div>Comments Comments Comments Comments Comments Comments</div>-->
|
||||
<!-- <div class="rightFloat">-Posted by date, time</div>-->
|
||||
<!-- <br /><br />-->
|
||||
<!-- </div>-->
|
||||
<!-- <br />-->
|
||||
<!-- <a href="" class="rightFloat">More>></a>
|
||||
-->
|
||||
|
||||
</div> <!-- end buzz -->
|
||||
|
||||
<div id="notes" class="tab_content">
|
||||
|
|
Loading…
Reference in New Issue
Block a user