From 13e307ec5cd1927fe74d8719eb6b40b516d62f22 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Sat, 21 Sep 2013 14:33:53 +0530 Subject: [PATCH] if statement for notes; display workshops / events in group template --- itf/itfprofiles/models.py | 3 + itf/templates/modules/events/event.html | 2 + .../modules/itfprofiles/production.html | 2 + .../modules/itfprofiles/theatregroup.html | 131 ++++++++---------- itf/templates/modules/scriptbank/script.html | 2 + 5 files changed, 65 insertions(+), 75 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 3f4fde2..d370218 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -366,6 +366,7 @@ class TheatreGroup(ItfModel): return False def get_dict(self): + return { #'object':self, 'name': self.name, @@ -383,6 +384,8 @@ class TheatreGroup(ItfModel): 'resources': [obj for obj in self.resources.all()], 'buzzitems': [obj for obj in self.buzzitems.all()], 'productions': [obj for obj in self.production_set.all() ], + 'workshops': [obj for obj in self.event_set.filter(event_type='workshop')], + 'other_events': [obj for obj in self.event_set.exclude(event_type='workshop')], '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() diff --git a/itf/templates/modules/events/event.html b/itf/templates/modules/events/event.html index 6dab660..cadd744 100644 --- a/itf/templates/modules/events/event.html +++ b/itf/templates/modules/events/event.html @@ -22,7 +22,9 @@ $(function() {
  • Gallery
  • {% endif %}
  • Buzz
  • + {% if user_has_perms or notes %}
  • Notes
  • + {% endif %}
  • Contact
  • diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index f5cf3a1..58b985a 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -15,7 +15,9 @@ $(function() {
  • Cast and Crew
  • Gallery
  • Buzz
  • + {% if user_has_perms or notes %}
  • Notes
  • + {% endif %} {% if shows %} diff --git a/itf/templates/modules/itfprofiles/theatregroup.html b/itf/templates/modules/itfprofiles/theatregroup.html index 430c13f..83bde64 100644 --- a/itf/templates/modules/itfprofiles/theatregroup.html +++ b/itf/templates/modules/itfprofiles/theatregroup.html @@ -7,7 +7,9 @@
  • Plays & more
  • Gallery
  • {% if resources %}
  • Resources
  • {% endif %} + {% if user_has_perms or notes %}
  • Notes
  • + {% endif %}
    @@ -174,6 +176,7 @@
    + {% if productions %}

    Plays & more

    {% for p in productions %} @@ -182,87 +185,65 @@ {{ p.name }}
    + +
    + +
    + {% endfor %} + {% endif %} + + {% if workshops %} +

    Workshops

    + + {% for w in workshops %} +
    +
    + +
    +
    -
    {{ p.name }} {% if p.debut_date %} {{ debut_date|date:"Y" }} {% endif %}
    - - + +
    {{ w.oneliner }}
    +
    +
    + +
    + {% endfor %} + + {% endif %} + {% if other_events %} +

    Other Events

    + + {% for o in other_events %} +
    +
    + {{ o.title }} +
    + +
    + +
    {{ o.oneliner }}
    +
    {% endfor %} - - - -

    Workshops (not implemented)

    - -
    -
    - /static/images/150x150.jpg -
    - -
    -
    Name of workshops
    -
    One line desc
    -
    Current
    -
    -
    - -
    - -
    -
    - /static/images/150x150.jpg -
    - -
    -
    Name of workshops
    -
    One line desc
    -
    -
    - -
    - -
    - - More>> - -
    - - -

    More

    - -
    -
    - /static/images/150x150.jpg -
    - -
    -
    Name of activity (talk, whatever)
    -
    One line desc
    -
    Current
    -
    -
    - -
    - -
    -
    - /static/images/150x150.jpg -
    - -
    -
    Name of activity (talk, whatever)
    -
    One line desc
    -
    Current
    -
    -
    - -
    - + {% endif %}