{% load thumbnail %}
<link rel="stylesheet" href="/static/css/modules/tabsinnerright.css" type="text/css" />

<script>
$(function() {
    $('.toggleLink').click(function(e) {
        e.preventDefault();
        $(this).next().slideToggle();
    });
});
</script>

<ul class="tabsInnerRight">
    <li><a href="#about">About</a></li>
    <li><a href="#productions">Productions</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 %}
</ul>    

<div id="about" class="tab_content">

    <h3>{{ title }}</h3>
    {% if author %}
    <div><strong>Writer:</strong> {{ author }}</div>
    {% endif %}
    {% if language %}
    <div><strong>Language:</strong> {{ language }}</div>
    {% endif %}

    {% if approx_duration %}
    <div><strong>Approximate duration:</strong> {{ approx_duration }} minutes</div>
    {% endif %}

    {% if no_characters %}
    <div><strong>No of characters:</strong> {{ no_characters }} - Female: {{ no_of_women }}, Male: {{ no_of_men }}</div>
    {% endif %}

    <br />
    
    <div>
	{{ synopsis }}
    </div>
    
    <br />
    
    <h5 class="orangeInnerRight">Licenses:</h5>
    
    <p>This script may be accessed
    under the following Creative Commons Licenses:</p>

    <a href="" class="toggleLink">Adaptation License: {{ license_adapt.name }}</a>
    
    <div class="toggleDiv">
        <p>{{ license_adapt.short_description|linebreaksbr }} <span style="color:red;">Does this need to be an accordion?</span></p>
        <a href="{{ license_adapt.legal_file.url }}" target="_blank" class="block">Read legal version</a>
    </div>

    <br>

    <a href="" class="toggleLink">Performance License: {{ license_perform.name }}</a>
    
    <div class="toggleDiv">
        <p>{{ license_perform.short_description|linebreaksbr }} </p>
        <a href="{{ license_perform.legal_file.url }}" target="_blank" class="block">Read legal version</a>
    </div>

    <br><br>

    {% if script_file %}
    <a href="{{ script_file }}" target="_blank">Download</a>
    {% endif %}

</div> <!-- end synopsis -->


<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">
	    <img src="" alt="/static/images/150x150.jpg" />
	</div>
	
	<div class="productionEachTextA">
	    <a href="{{ p.get_absolute_url }}" class="tooltipLink">{{ p.name }}
                <!--
	            <span class="tooltip">
			<div>
                {{ p.synopsis|truncatewords:15 }}
                 
			    <strong>Some Title</strong><br />
			    Some text goes here
                
			</div>
		    </span>
                -->
	    </a>
	    {% if p.group %} <div>Group: {{ p.group.name }}</div> {% endif %}
	    <div>{{ p.synopsis|truncatewords:20 }}</div>
	    <!-- <div>No. of shows: 50</div> -->
	</div>
    <div class="clear"></div> 
 
    </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">
	<div class="productionEachImg">
	    <img src="" alt="/static/images/150x150.jpg" />
	</div>
	
	<div class="productionEachTextA">
	    <a href="{{ p.get_absolute_url }}" class="tooltipLink">{{ p.name }}
                <!--
	            <span class="tooltip">
			<div>
                {{ p.synopsis|truncatewords:15 }}
                 
			    <strong>Some Title</strong><br />
			    Some text goes here
                
			</div>
		    </span>
                -->
	    </a>
	    {% if p.group %} <div>Group: {{ p.group.name }}</div> {% endif %}
	    <div>{{ p.synopsis|truncatewords:20 }}</div>
	    <!-- <div>No. of shows: 50</div> -->
	</div>
    <div class="clear"></div> 
 
    </div> <!-- end production each -->
    {% endfor %}
    {% else %}
    <p>No related productions</p>
    {% endif %}
</div> <!-- end productions -->

{% if related_people %}
<div id="people" class="tab_content">
    
    {% for r in related_people %}
    <div class="productionEach">
	<div class="productionEachImg">
	    <img src="" alt="/static/images/150x150.jpg" />
	</div>
	
	<div class="productionEachTextA">
        {% if r.person.get_absolute_url %}
	    <a href="{{ r.person.get_absolute_url }}">{{ r.person.first_name }} {{ r.person.last_name }}</a>
        {% else %}
        <div>{{ r.person }}</div>
        {% endif %}
	    <div>{{ r.role }}: {{ r.assoc_name }}</div>
	    
<!--	    <a href="" class="toggleLink orange">Synopsis</a>-->
	    <!-- <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">

    <div class="noteEach">
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
	quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
	esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis
	dolore te feugait nulla facilisi.</p>
	<p class="noteMetaData">- posted by Name, Date, Time</p>
    </div>

    <div class="noteEach">
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
	quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
	esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis
	dolore te feugait nulla facilisi.</p>
	<p class="noteMetaData">- posted by Name, Date, Time</p>
    </div>

    <div class="noteEach">
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
	quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
	esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis
	dolore te feugait nulla facilisi.</p>
	<p class="noteMetaData">- posted by Name, Date, Time</p>
    </div>

    <div class="noteEach">
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
	quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
	esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis
	dolore te feugait nulla facilisi.</p>
	<p class="noteMetaData">- posted by Name, Date, Time</p>
    </div>
    
</div> <!-- end notes -->


{% if resources %}
<div id="resources" class="tab_content">
    {% for r in resources %}
    <div class="resourcesBlock">
	<div class="resourcesEach">
	    <div><strong>{{ r.title }}</strong></div>
	    <div>{{ r.desc }}</div>
        {% if r.url %}
	    <div><a href="{{ r.url }}" target="_blank">{{ r.url }}</a></div>
        {% endif %}
        {% if r.fil %}
	    <a href="{{ r.fil.url }}" target="_blank">Download</a>
        {% endif %}
	</div>
	
    
	<div class="productionEachImg">
        {% if r.thumbnail %}
        {% thumbnail r.thumbnail "150x150" crop="center" as thumb %}
	    <img src="{{ thumb.url }}" alt="" />
        {% endthumbnail %}
        {% else %}
        <img src="" alt="/static/images/150x150.jpg" />
        {% endif %}
	</div>	
    <div class="clear"></div>
    </div> <!-- end resources block -->
    {% endfor %} 
</div>
{% endif %}
	
<div id="gallery" class="tab_content">

    {% include 'includes/media_gallery.html' %}

</div> <!-- end gallery -->

<script type="text/javascript" src="/static/js/innertabs.js"></script>

<br />
<a href="{{ edit_url }}">Edit</a>
