From 58f7e11cd3c3f4c312c4f8483165c18feb76f29b Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 8 Sep 2012 01:55:21 +0530 Subject: [PATCH] templates - resources for people + move things around a little --- itf/itfprofiles/models.py | 10 ++ itf/templates/modules/itfprofiles/person.html | 32 ++++++- .../modules/itfprofiles/theatregroup.html | 91 ++++++++----------- 3 files changed, 76 insertions(+), 57 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 88f561c..ef71d82 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -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): diff --git a/itf/templates/modules/itfprofiles/person.html b/itf/templates/modules/itfprofiles/person.html index bcc158f..ae9cb94 100644 --- a/itf/templates/modules/itfprofiles/person.html +++ b/itf/templates/modules/itfprofiles/person.html @@ -10,7 +10,6 @@
- A brief bio and a history of work. should be able to add photos here {% if image %}

Photo :

@@ -153,7 +152,6 @@
- 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 %}
@@ -201,7 +199,6 @@
- Title of each production links to "Productions" page. {% if productions %}
@@ -224,7 +221,34 @@
- 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 %} +
+

Resources:

+ + +
+ + {% endif %} +
diff --git a/itf/templates/modules/itfprofiles/theatregroup.html b/itf/templates/modules/itfprofiles/theatregroup.html index 42e39a4..9a16c4a 100644 --- a/itf/templates/modules/itfprofiles/theatregroup.html +++ b/itf/templates/modules/itfprofiles/theatregroup.html @@ -12,7 +12,6 @@

{{ name }}

- A brief bio and a history of work. should be able to add photos here {% if email %} @@ -119,7 +118,6 @@
- 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 %}
@@ -148,7 +146,7 @@
- Title of each production links to "Productions" page. + {% if productions %}
@@ -168,6 +166,42 @@ + +
+ + + + {% if resources %} +
+ Resources:

+ + +
+ + +
+ +
+ {% if awards %}
Awards: @@ -193,59 +227,10 @@
{% endif %} -
- -
- 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 %} -
- Resources: -
    - {% for elem in resources %} -
  • - {% if elem.url %} - - {% endif %} - {{ elem.title }} - - {% if elem.url %} - - {% endif %} -
  • -
  • - {% if elem.thumbnail %} - {{ elem.thumbnail }} - {% endif %} -
  • - -
  • - {% if elem.desc %} - {{ elem.desc }} - {% endif %} -
  • - -
  • - {{ elem.fil }} -
  • - -
  • {{ elem.url }}
  • - - {% endfor %} -
-
- {% endif %} - - -
- -
- 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 %}
- Scripts: + Scripts:

    {% for elem in scripts %}