From 0568402d9faba8ca9f43605532419974c2ac9eb3 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Wed, 22 Jan 2014 13:40:05 +0530 Subject: [PATCH] twitter upgrade to new api, fix comments form, fix roles in cast and crew --- itf/frontpage/views.py | 6 +++--- itf/templates/modules/itfprofiles/production.html | 3 ++- itf/templates/noel/index.html | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/itf/frontpage/views.py b/itf/frontpage/views.py index cd885d0..109af78 100755 --- a/itf/frontpage/views.py +++ b/itf/frontpage/views.py @@ -9,6 +9,7 @@ from django.forms.widgets import Textarea from django.utils.html import urlize from django.core.mail import send_mail from django.views.decorators.cache import cache_page +from utils import get_latest_tweets class ContactForm(forms.Form): name = forms.CharField(max_length=255) @@ -36,14 +37,13 @@ class ContactForm(forms.Form): #@cache_page(60 * 30) def index(request): try: - tApi = twitter.Api() - statuses = tApi.GetUserTimeline(TWITTER_ID)[0:3] + statuses = get_latest_tweets() except: statuses = [] boxes = SliderBox.objects.filter(is_displayed=True) front_images = FrontImage.objects.filter(is_active=True)[0:3] return render_to_response("noel/index.html", RequestContext(request, { - 'tweets': [urlize(s.text) for s in statuses], + 'tweets': [urlize(s['text']) for s in statuses], 'boxes': boxes, 'front_images': front_images })) diff --git a/itf/templates/modules/itfprofiles/production.html b/itf/templates/modules/itfprofiles/production.html index 58b985a..a6aafce 100644 --- a/itf/templates/modules/itfprofiles/production.html +++ b/itf/templates/modules/itfprofiles/production.html @@ -148,7 +148,7 @@ $(function() {
- {{ p.role }}: {{ p.person.first_name }} {{ p.person.last_name }} + {{ p.role|title }}: {{ p.person.first_name }} {{ p.person.last_name }}
{{ p.person.about|truncatewords:80 }}
@@ -204,6 +204,7 @@ $(function() {
diff --git a/itf/templates/noel/index.html b/itf/templates/noel/index.html index fbce1fc..fb2c7bf 100755 --- a/itf/templates/noel/index.html +++ b/itf/templates/noel/index.html @@ -66,11 +66,12 @@ - +

EVENTS

-
Coming Soon +
+
arrow-left