From a6ca7d815ca0cf039e4d80eae796b3cab7ab06be Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 12 Aug 2013 16:04:47 +0530 Subject: [PATCH 01/11] linebreaksbr for script licenses --- itf/itfprofiles/admin.py | 1 + itf/templates/modules/scriptbank/script.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/itf/itfprofiles/admin.py b/itf/itfprofiles/admin.py index f1f4855..c540e42 100755 --- a/itf/itfprofiles/admin.py +++ b/itf/itfprofiles/admin.py @@ -52,6 +52,7 @@ class CityAdmin(admin.ModelAdmin): admin.site.register(Occupation, OccupationAdmin) +admin.site.register(GroupOccupation) admin.site.register(Relation, RelationAdmin) admin.site.register(TheatreGroup, TheatreGroupAdmin) admin.site.register(Person) diff --git a/itf/templates/modules/scriptbank/script.html b/itf/templates/modules/scriptbank/script.html index 133231f..c2f0a37 100755 --- a/itf/templates/modules/scriptbank/script.html +++ b/itf/templates/modules/scriptbank/script.html @@ -53,7 +53,7 @@ $(function() { Adaptation License: {{ license_adapt.name }}
-

{{ license_adapt.short_description }} Does this need to be an accordion?

+

{{ license_adapt.short_description|linebreaksbr }} Does this need to be an accordion?

Read legal version
@@ -62,7 +62,7 @@ $(function() { Performance License: {{ license_perform.name }}
-

{{ license_perform.short_description }}

+

{{ license_perform.short_description|linebreaksbr }}

Read legal version
From 35f512353b673912233bc568fc0f1c0cf8657ad5 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 12 Aug 2013 16:25:30 +0530 Subject: [PATCH 02/11] productions --- itf/itfprofiles/models.py | 7 +- .../modules/itfprofiles/production.html | 71 ++++++++++++++----- 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index 57ad7d9..b08f4c7 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -449,9 +449,13 @@ class Production(ItfModel): def get_dict(self): + from events.models import Event rel_level1 = [obj for obj in Production.objects.filter(script=self.script)] rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all())) - + shows = Event.objects.filter(production=self) + last_date = None + if shows.count() > 0: + last_date = shows.order_by('-start_date')[0].start_date return { 'name': self.name, 'anecdotes': self.anecdotes, @@ -463,6 +467,7 @@ class Production(ItfModel): 'awards': [ obj for obj in self.awards.all()], 'languages': [ obj for obj in self.languages.all()], 'debut_date':self.debut_date, + 'last_date': last_date, 'sibling_productions': rel_level1, 'related_productions' : rel_level2, 'people': self.get_people() diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index 10e6ec3..d74d521 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -58,46 +58,81 @@ $(function() {

{{ name }}

{% if group %}
Group: {{ group.name }}
{% endif %} -
Languages: Hindi, English, etc.
-
From 2011 to 2013
-
No of Shows: range/number
+ {% if languages %} +
Languages: + {% for language in languages %} + {{ language.name }} + {% endfor %} +
+ {% endif %} +
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }}
+ {% comment %} +
No of Shows:
Book Now>>

+ {% endcomment %}

-
Writers: Name (playwright), name (adaptation), name (translation)
-
Director: Hindi, English, etc.
-
Credits: name (research), name (music)
+ {% if playwright %} +
Writer: + + {{ playwright }} + +
+ {% endif %} + {% if director %} +
Director: + {% if director %} + + {{ director }} + + {% endif %} +
+
-

Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph. - Some copy here that is a synopsis in a paragraph. Some copy here that is a synopsis in a paragraph.

+

+ {{ synopsis|linebreaksbr }} +

- Contact -
Group website
+ + {% if group.website %} +
Group website: {{ group.website }}
+ {% endif %}

- + {% if awards %}
Awards
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
-
Name of award, name of awardee, year, link
+ {% for award in awards %} +
+ {{ award.title }} + {% if award.year %}, + {{ award.year }} + {% endif %} + {% if award.link %}, + link + {% endif %} + +
+ {% endfor %} + +
+ {% endif %}
- +
@@ -115,13 +151,14 @@ $(function() {
From 1c88510391dacfc70bd35e18b1acf96eb35958dc Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 12 Aug 2013 16:39:48 +0530 Subject: [PATCH 03/11] hacky fix for search results error --- itf/app/models.py | 10 ++++++++-- itf/templates/search/search.html | 9 +++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index ae441cf..145a728 100755 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -145,7 +145,10 @@ class ItfModel(models.Model): #Get the ModuleTab object associated with this object. def get_tab(self): modelextra = self.get_modelextra() - tab = ModuleTab.objects.filter(model=modelextra)[0] + if modelextra: + tab = ModuleTab.objects.filter(model=modelextra)[0] + else: + tab = ModuleTab.objects.all()[0] #FIXME!!! return tab @@ -182,7 +185,10 @@ class ItfModel(models.Model): except:#FIXME: ideally catch only MultipleObjectsReturned (figure out where to import that from :/ ) #FUCKING way ugly hack to get clashing model ctype names with django internal models working (get_real_ctypes simply checks, if there are multiple content objects with the same 'module_name', which one is_itf_model, and returns that). ctype = get_real_ctype(self.__class__._meta.module_name) # modelextra = ModelExtra.objects.filter(model=ctype)[0] - modelextra = ctype.modelextra_set.all()[0] + try: + modelextra = ctype.modelextra_set.all()[0] + except: + modelextra = None return modelextra ''' diff --git a/itf/templates/search/search.html b/itf/templates/search/search.html index 2b01f32..21f16da 100755 --- a/itf/templates/search/search.html +++ b/itf/templates/search/search.html @@ -33,16 +33,17 @@

YOUR RESULTS:

{% for result in page.object_list %} - {{ result.object.title }} - {{ result.text|truncatewords:60|markdown|safe }} + + + {{ result.object }} + {{ result.text|truncatewords:60|markdown|striptags }}

- + {% empty %}

No results found.

{% endfor %} - {% else %} {# Show some example queries to run, maybe query syntax, something else? #} {% endif %} From 40aa62f687ca0f283d3b877bc4767078b1d843fc Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 12 Aug 2013 16:50:24 +0530 Subject: [PATCH 04/11] fix file uploads by adding form enctype --- itf/templates/test/person_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itf/templates/test/person_form.html b/itf/templates/test/person_form.html index 98b7ccb..7169c83 100644 --- a/itf/templates/test/person_form.html +++ b/itf/templates/test/person_form.html @@ -177,7 +177,7 @@ $(function(){ Please correct the errors below and re-submit.
{% endif %} -
+ {% csrf_token %}
From 3a19473a4bc9e2fa241422c617b5c5d0b4bbc254 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Tue, 13 Aug 2013 12:08:47 +0530 Subject: [PATCH 05/11] add shows to productions --- itf/itfprofiles/models.py | 5 +- .../modules/itfprofiles/production.html | 115 +++++------------- 2 files changed, 32 insertions(+), 88 deletions(-) diff --git a/itf/itfprofiles/models.py b/itf/itfprofiles/models.py index b08f4c7..c456a53 100644 --- a/itf/itfprofiles/models.py +++ b/itf/itfprofiles/models.py @@ -452,10 +452,10 @@ class Production(ItfModel): from events.models import Event rel_level1 = [obj for obj in Production.objects.filter(script=self.script)] rel_level2 = list(set(obj.production_set.all() for obj in self.script.related_scripts.all())) - shows = Event.objects.filter(production=self) + shows = Event.objects.filter(production=self).order_by('-start_date') last_date = None if shows.count() > 0: - last_date = shows.order_by('-start_date')[0].start_date + last_date = shows[0].start_date return { 'name': self.name, 'anecdotes': self.anecdotes, @@ -465,6 +465,7 @@ class Production(ItfModel): 'script': self.script, 'synopsis': self.synopsis, 'awards': [ obj for obj in self.awards.all()], + 'shows': shows, 'languages': [ obj for obj in self.languages.all()], 'debut_date':self.debut_date, 'last_date': last_date, diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index d74d521..14b481c 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -10,7 +10,7 @@ $(function() { +{% if shows %}

{{ name }}

- (to be implemented) - - - - - - - - - - - - - - - - - - - - - - - - + {% for show in shows %} + + + + + + + + + {% endfor %}
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
DateTimeVenue, CityBook Now/Full
+ {{ show.start_date|date:"d M, Y" }} + + {{ show.start_time|time:"P" }} + + {{ show.city.name }} + + {% if show.booking_link %} + Book now + {% else %} + More details + {% endif %} +
-More>> +
+{% endif %}
@@ -65,14 +64,14 @@ $(function() { {% endfor %}
{% endif %} -
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }}
+
From {{ debut_date|date:"Y" }} {% if last_date %} - {{ last_date|date:"Y" }} {% endif %}
{% comment %}
No of Shows:
Book Now>>

- {% endcomment %}
+ {% endcomment %}
{% if playwright %} @@ -84,12 +83,11 @@ $(function() { {% endif %} {% if director %}
Director: - {% if director %} {{ director }} - {% endif %}
+ {% endif %} @@ -132,18 +130,6 @@ $(function() { {% endif %}
-
@@ -151,30 +137,11 @@ $(function() {
{% include 'includes/buzzitems.html' %} -
{% load comments %} @@ -218,30 +185,6 @@ $(function() {
{% endif %} - - - - - - - - - - - - - - - - - - - - - - -
From 8bd2584ffbd0bd7f11f32924140d6cdb1e217199 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Wed, 4 Sep 2013 15:07:57 +0530 Subject: [PATCH 06/11] display currently logged in username --- itf/static/css/noel/main.css | 14 ++++++++++---- itf/templates/noel/base.html | 9 +++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/itf/static/css/noel/main.css b/itf/static/css/noel/main.css index 2871728..8d8b124 100755 --- a/itf/static/css/noel/main.css +++ b/itf/static/css/noel/main.css @@ -272,7 +272,13 @@ cursor:pointer; z-index:2; clear:both;} -#loginMenu li +#loginMenu li.usernameDisplay { + float: left; + display: inline; + padding: 6px 6px; +} + +#loginMenu li.loginTab {display:inline; float:left; background-color:#FFF; @@ -288,16 +294,16 @@ border-top-left-radius:8px; -webkit-box-shadow:0px -1px 3px #d4d4d4; box-shadow:0px -1px 3px #d4d4d4;}/*not converted to links*/ -#loginMenu li a, #loginMenu li a:link, #loginMenu li a:visited, #loginMenu li a:active +#loginMenu li.loginTab a, #loginMenu li.loginTab a:link, #loginMenu li.loginTab a:visited, #loginMenu li.loginTab a:active {text-decoration:none; color:#ff8400;} -#loginMenu li:hover +#loginMenu li.loginTab:hover {color:#FFF; background-color:#f7bd00; border:1px solid transparent;} -#loginMenu li:hover a +#loginMenu li.loginTab:hover a {color:#FFF;} .loginMenuSelected diff --git a/itf/templates/noel/base.html b/itf/templates/noel/base.html index 2efd996..7ed4c6d 100755 --- a/itf/templates/noel/base.html +++ b/itf/templates/noel/base.html @@ -48,13 +48,14 @@
From 0ae1901b2367c663173206bd4cdd9da80a43d237 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Wed, 4 Sep 2013 15:13:01 +0530 Subject: [PATCH 07/11] fix unclosed div on productions --- .../modules/itfprofiles/production.html | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index 14b481c..5e13299 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -163,21 +163,22 @@ $(function() {

Your comments

-
- {% get_comment_form for obj as form %} - - {% csrf_token %} - - {{ form.as_p }} -

- -

+
+ {% get_comment_form for obj as form %} + + {% csrf_token %} + + {{ form.as_p }} +

+ +

- - - + + + +
{% else %}
@@ -193,6 +194,5 @@ $(function() { -
Edit From cd475065e03b59c1228c2c0ccefc6dbec4c4153d Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Wed, 4 Sep 2013 15:23:32 +0530 Subject: [PATCH 08/11] see full credits should open cast tab --- itf/templates/modules/itfprofiles/production.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index 5e13299..edddeb2 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -89,7 +89,7 @@ $(function() {
{% endif %} - +
From 5421eaecbcd5df2da34ff22561d0008501c5ce0d Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Wed, 4 Sep 2013 15:59:30 +0530 Subject: [PATCH 09/11] add cast and crew to productions --- .../modules/itfprofiles/production.html | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index edddeb2..e7c113b 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -133,6 +133,32 @@ $(function() {
+ + +
Cast and Crew
+
+ {% if people %} + {% for p in people %} + +
+
+ /static/images/150x150.jpg +
+ +
+ {{ p.role }}: {{ p.person.first_name }} {{ p.person.last_name }} +
+ {{ p.person.about|truncatewords:80 }} +
+ +
+
+ +
+ + {% endfor %} + {% endif %} +