twitter upgrade to new api, fix comments form, fix roles in cast and crew

This commit is contained in:
Sanjay B 2014-01-22 13:40:05 +05:30
parent a83c3f4487
commit 0568402d9f
3 changed files with 8 additions and 6 deletions

View File

@ -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
}))

View File

@ -148,7 +148,7 @@ $(function() {
</div>
<div class="productionEachTextA">
{{ p.role }}: <a href="{{ p.person.get_absolute_url }}">{{ p.person.first_name }} {{ p.person.last_name }}</a>
<b>{{ p.role|title }}:</b> <a href="{{ p.person.get_absolute_url }}">{{ p.person.first_name }} {{ p.person.last_name }}</a>
<div>
{{ p.person.about|truncatewords:80 }}
</div>
@ -204,6 +204,7 @@ $(function() {
</form>
<script>
$('#id_honeypot').closest('p').hide();
$('#id_url').closest('p').hide();
</script>
</div>

View File

@ -66,11 +66,12 @@
</div>
</div>
</div>
<a href="/m/events">
<div id="events" class="tab">
<h3 class="tabHeader">EVENTS</h3>
<a href="/page/events-coming-soon/" class="buttonTab"> Coming Soon </a>
<!-- <a href="/page/events-coming-soon/" class="buttonTab"> Coming Soon </a> -->
</div>
</a>
<div id="slider">
<img src="/static/images/noel/arrow-lft.png" width="27" height="39" alt="arrow-left" id="arrowLeft">