templates - resources for people + move things around a little

This commit is contained in:
Sanj 2012-09-08 01:55:21 +05:30
parent 4651277992
commit 58f7e11cd3
3 changed files with 76 additions and 57 deletions

View File

@ -49,6 +49,7 @@ class Person(ItfModel):
languages = models.ManyToManyField("Language", blank=True, null=True) #s added
awards = generic.GenericRelation("Award")
buzzitems = generic.GenericRelation("BuzzItem")
resources = generic.GenericRelation("Resource")
# photos = models.ManyToManyField("PhotoAlbum", blank=True, null=True)
# orphans = models.ManyToManyField("Orphan", blank=True, null=True, through='PersonOrphan')
@ -90,6 +91,7 @@ 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()
}
@ -305,6 +307,14 @@ class Resource(models.Model):
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
def get_link(self):
if self.fil:
return self.fil.url
elif self.url:
return self.url
else:
return False
from scriptbank.models import Script
class Production(ItfModel):

View File

@ -10,7 +10,6 @@
</ul>
<div id="about" class="tab_content">
A brief bio and a history of work. should be able to add photos here
{% if image %}
<p class="orange"> Photo : </p>
@ -153,7 +152,6 @@
</div>
<div id="people" class="tab_content">
Active Members, Associates, (Fans? - maybe this is a link with a list popout, so they are not perceived as internal to the group). Photos of users on site should show up. We must SEE the community. Noel needs to send a design for tha tab, which will be used across all "People" tabs.
{% if groups %}
<div id="" class="itfFormDisplay">
@ -201,7 +199,6 @@
</div>
<div id="production" class="tab_content">
Title of each production links to "Productions" page.
{% if productions %}
<div id="" class="itfFormDisplay">
@ -224,7 +221,34 @@
</div>
<div id="resources" class="tab_content">
books, CDs, DVDs, scripts - anything the group owns. This can be images, text or links. backend - user should be asked to label the item. Optional
{% if resources %}
<div class="itfFormDisplay">
<p class="orange">Resources: </p>
<ul>
{% for elem in resources %}
<li>
<span class="orange">Title: </span>
{% if elem.get_link %}
<a href="{{ elem.get_link }}" target="_blank">
{% endif %}
{{ elem.title }}
{% if elem.get_link %}
</a>
{% endif %}
<br />
{% if elem.desc %}
<span class="orange">Description: </span> {{ elem.desc }} <br />
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<div id="notes" class="tab_content">

View File

@ -12,7 +12,6 @@
<div id="about" class="tab_content">
<h3> {{ name }}</h3>
A brief bio and a history of work. should be able to add photos here
{% if email %}
@ -119,7 +118,6 @@
<div id="people" class="tab_content">
Active Members, Associates, (Fans? - maybe this is a link with a list popout, so they are not perceived as internal to the group). Photos of users on site should show up. We must SEE the community. Noel needs to send a design for tha tab, which will be used across all "People" tabs.
{% if people %}
<div id="" class="itfFormDisplay">
@ -148,7 +146,7 @@
</div>
<div id="production" class="tab_content">
Title of each production links to "Productions" page.
{% if productions %}
<div id="" class="itfFormDisplay">
@ -168,6 +166,42 @@
<div id="gallery" class="tab_content">
Photos & Videos. There should be a clear demarcation between Photos and Videos
</div>
<div id="resources" class="tab_content">
{% if resources %}
<div class="itfFormDisplay">
<span class="orange">Resources: </p>
<ul>
{% for elem in resources %}
<li>
<span class="orange">Title: </span>
{% if elem.get_link %}
<a href="{{ elem.get_link }}" target="_blank">
{% endif %}
{{ elem.title }}
{% if elem.get_link %}
</a>
{% endif %}
<br />
{% if elem.desc %}
<span class="orange">Description: </span> {{ elem.desc }} <br />
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
<div id="notes" class="tab_content">
{% if awards %}
<div id="" class="itfFormDisplay">
<span class="orange">Awards: </span>
@ -193,59 +227,10 @@
</div>
{% endif %}
</div>
<div id="resources" class="tab_content">
books, CDs, DVDs, scripts - anything the group owns. This can be images, text or links. backend - user should be asked to label the item. Optional
{% if resources %}
<div id="" class="itfFormDisplay">
<span class="orange">Resources: </span>
<ul>
{% for elem in resources %}
<li>
{% if elem.url %}
<a href="{{ elem.url }}">
{% endif %}
{{ elem.title }}
{% if elem.url %}
</a>
{% endif %}
</li>
<li>
{% if elem.thumbnail %}
{{ elem.thumbnail }}
{% endif %}
</li>
<li>
{% if elem.desc %}
{{ elem.desc }}
{% endif %}
</li>
<li>
{{ elem.fil }}
</li>
<li>{{ elem.url }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<div id="notes" class="tab_content">
Anything about the group (annotations & anecdotes in a sense). Anybody can add. These are scripts owned by the group. i.e the group is the author.
{% if scripts %}
<div id="" class="itfFormDisplay">
<span class="orange">Scripts: </span>
<span class="orange">Scripts: </p>
<ul>
{% for elem in scripts %}