Skip to content

Commit

Permalink
fb app events hashed
Browse files Browse the repository at this point in the history
  • Loading branch information
srmanikandasriram committed Oct 24, 2012
1 parent ccd16f0 commit 14f5dfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 7 additions & 7 deletions fb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def home(request):

@csrf_exempt
def hero(request):
#target = urllib.urlopen('https://graph.facebook.com/424935270885525/photos').read()
#photos = json.loads(target)["data"]
#srcs=[]
#for photo in photos:
#srcs.append(photo["images"][0]["source"])
target = urllib.urlopen('https://graph.facebook.com/424935270885525/photos').read()
photos = json.loads(target)["data"]
srcs=[]
for photo in photos:
srcs.append(photo["images"][0]["source"])
return render_to_response('fb/hero.html', locals(),
context_instance=RequestContext(request))
@csrf_exempt
Expand All @@ -101,8 +101,8 @@ def events(request, event_name):
return HttpResponseRedirect(url)
except:
pass
# event_intro = "Desciption comes here!"
event_intro = event.mobapptab.text
event_intro = "Desciption comes here!"
# event_intro = event.mobapptab.text
return render_to_response('ajax/fb/events.html', locals(),
context_instance=RequestContext(request))

Expand Down
14 changes: 5 additions & 9 deletions templates/fb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div id="{{category.0.category|slugify}}" class="accordion-body collapse">
<ul>
{% for event in category %}
<li><a href="#" onclick="show('{{event.title|slugify}}');">{{event.title}}</a></li>
<li><a href="#events/{{event.title|slugify}}">{{event.title}}</a></li>
{% endfor %}
</ul>
</div>
Expand Down Expand Up @@ -173,13 +173,16 @@
cache[url].show();
$( '.bbq-loading' ).hide();
} else {
cache[url] = $( '<div class="bbq-item"></div>' )
cache[url] = $( '<div id='+url+' class="bbq-item"></div>' )
.appendTo( '.bbq-content' )

// Load external content via AJAX. Note that in order to keep this
// example streamlined, only the content in .infobox is shown. You'll
// want to change this based on your needs.
.load( url, function(){
if(temp[0]=='events'){
FB.XFBML.parse(document.getElementById(url));
}
$( '.bbq-loading' ).hide();
});
}
Expand All @@ -201,13 +204,6 @@
<!-- jQuery functions -->
<!-- JS functions -->
<script type="text/javascript">
function show(event_id){
$('#content').fadeOut();
$('#content').load('{{site_url}}fb/events/'+event_id,function(){
FB.XFBML.parse(document.getElementById('content'));
$('#content').fadeIn();
});
}
</script>
<!-- End JS functions -->
<!--Script to search-->
Expand Down

0 comments on commit 14f5dfe

Please sign in to comment.