Permalink
Browse files

fixed merge conflict

  • Loading branch information...
2 parents 40a8e80 + 6c8df9e commit 3ca28adca0c20fe172a40ad0ef27b03e79b5ec2f @cuttlewig cuttlewig committed Sep 24, 2011
View
@@ -7,7 +7,7 @@
import time
import datetime
-from flask import Flask, session, request, redirect, render_template
+from flask import Flask, session, request, redirect, render_template, jsonify
from flaskext.sqlalchemy import SQLAlchemy
from models import app, db, Fbuser, Task, Comment
@@ -18,7 +18,6 @@
app = Flask(__name__)
-@decorators.memoized
def get_me():
return fb_call('me', args={'access_token': session['access_token']})
@@ -160,6 +159,15 @@ def get_fully_qualified_path(short_path='/'):
else:
return 'https://' + request.host + short_path
+@app.route('/typeahead/json/', methods=['GET'])
+def typeahead():
+ if 'access_token' in session and int(session['expires']) >= time.time():
+ user_friends = fb_call('me/friends',
+ args={'access_token':
+ session['access_token']})
+ return jsonify(user_friends)
+ else:
+ return jsonify({})
@app.route('/close/', methods=['GET', 'POST'])
def close():
@@ -259,16 +267,16 @@ def make_comment(content=None):
author = me['id']
creation_time = datetime.datetime.today()
task_id = request.form['task_id']
-
+
comment = Comment(comment_id, task_id, datetime.datetime.today(), author, contents)
db.session.add(comment)
db.session.commit()
to_return = '<div class="well"> <div class="clearfix"> <img src="https://graph.facebook.com/' + author + '/picture" class="small-picture"> <strong>' + str(me['name']) + ' says...</strong> </div> <br> <blockquote> <p>' + contents + '</p> <br> <small>posted at ' + str(creation_time) + '</small> </blockquote> </div>'
return to_return
raise Exception
-
-
+
+
@app.route('/task/<t_id>/', methods=['GET'])
@ensure_fb_auth
def view_task(t_id):
View
@@ -9,9 +9,9 @@ $(function () {
success: function(response) {
$('#create_button').removeAttr('disabled');
$('#main_content').load('ajax/home/');
- $('#top_create').attr('class', '');
- $('#top_mytasks').attr('class', 'active');
- }
- });
+ $('#top_create').attr('class', '');
+ $('#top_mytasks').attr('class', 'active');
+ }
+ });
});
});
Oops, something went wrong.

0 comments on commit 3ca28ad

Please sign in to comment.