From 77fdef9234f316561a2f6b3098fc0f5fd3e99cc0 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Sun, 2 Aug 2015 13:48:09 +0530 Subject: [PATCH] fix image thumbs on event people / groups, add some categories --- itf/events/models.py | 10 ++- itf/templates/modules/events/event.html | 92 +++++++++++++++++++++++-- 2 files changed, 95 insertions(+), 7 deletions(-) diff --git a/itf/events/models.py b/itf/events/models.py index 0cdddde..dba0bbd 100644 --- a/itf/events/models.py +++ b/itf/events/models.py @@ -106,7 +106,8 @@ class Event(ItfModel): groups= { 'venue': [ obj.group for obj in self.groupevent_set.filter(typ='venue')], 'performing': [ obj.group for obj in self.groupevent_set.filter(typ='performing')], - 'organizers': [ obj.group for obj in self.groupevent_set.filter(typ='organizers')] + 'organizers': [ obj.group for obj in self.groupevent_set.filter(typ='organizers')], + 'participating': [ obj.group for obj in self.groupevent_set.filter(typ='participating')] } rdict['groups']= groups rdict['has_people_tab'] = True @@ -114,7 +115,10 @@ class Event(ItfModel): if self.people.all(): people= { 'attendees': [ obj.person for obj in self.personevent_set.filter(typ='attendee')], + 'facilitators': [ obj.person for obj in self.personevent_set.filter(typ='facilitator')], + 'mentors': [ obj.person for obj in self.personevent_set.filter(typ='mentor')], 'organisers': [ obj.person for obj in self.personevent_set.filter(typ='organiser')], + 'participants': [ obj.person for obj in self.personevent_set.filter(typ='participant')], 'performers': [ obj.person for obj in self.personevent_set.filter(typ='performer')] } rdict['people']= people @@ -125,7 +129,10 @@ class Event(ItfModel): PERSON_EVENT_CHOICES = ( ('attendee', 'Attendee'), + ('facilitator', 'Facilitator'), + ('mentor', 'Mentor'), ('organiser', 'Organiser'), + ('participant', 'Participant'), ('performer', 'Performer'), ) @@ -139,6 +146,7 @@ GROUP_EVENT_CHOICES = ( ('venue', 'Venue'), ('performing', 'Performing'), ('organizers', 'Organizers'), + ('participating', 'Participating'), ) class GroupEvent(models.Model): diff --git a/itf/templates/modules/events/event.html b/itf/templates/modules/events/event.html index fb57549..f5432c1 100644 --- a/itf/templates/modules/events/event.html +++ b/itf/templates/modules/events/event.html @@ -80,7 +80,7 @@ $(function() { {% for person in people.organisers %}
- /static/images/150x150.jpg +
@@ -100,7 +100,7 @@ $(function() { {% for person in people.performers %}
- /static/images/150x150.jpg +
@@ -114,6 +114,45 @@ $(function() { {% endfor %} {% endif %} + {% if people.facilitators %} +
Facilitators
+ + {% for person in people.facilitators %} +
+
+ +
+ +
+ {{ person.first_name }} {{ person.last_name }} +
{{ person.about|truncatewords:40 }}
+
{{ person.locations.0.city.name }}
+
+
+ +
+ {% endfor %} + {% endif %} + + {% if people.mentors %} +
Mentors
+ + {% for person in people.mentors %} +
+
+ +
+ +
+ {{ person.first_name }} {{ person.last_name }} +
{{ person.about|truncatewords:40 }}
+
{{ person.locations.0.city.name }}
+
+
+ +
+ {% endfor %} + {% endif %} {% if people.attendees %}
Attendees
@@ -121,7 +160,7 @@ $(function() { {% for person in people.attendees %}
- /static/images/150x150.jpg +
@@ -135,6 +174,27 @@ $(function() { {% endfor %} {% endif %} + {% if people.participants %} +
Participants
+ + {% for person in people.participants %} +
+
+ +
+ +
+ {{ person.first_name }} {{ person.last_name }} +
{{ person.about|truncatewords:40 }}
+
{{ person.locations.0.city.name }}
+
+
+ +
+ {% endfor %} + {% endif %} + + {% if groups.organizers %}
Organizing Groups
@@ -142,7 +202,7 @@ $(function() {
- {{ group.name }} + {{ group.name }}
@@ -164,7 +224,7 @@ $(function() {
- {{ group.name }} + {{ group.name }}
@@ -185,7 +245,7 @@ $(function() {
- {{ group.name }} + {{ group.name }}
@@ -199,7 +259,27 @@ $(function() { {% endfor %} {% endif %} + {% if groups.participating %} +
Participating Groups
+ {% for group in groups.participating %} + +
+
+ {{ group.name }} +
+ +
+ {{ group.name }} +
{{ group.locations.0.city.name }}
+
+
+ +
+ + {% endfor %} + + {% endif %}