Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
cuttlewig committed Sep 24, 2011
2 parents 40a8e80 + 6c8df9e commit 3ca28ad
Show file tree
Hide file tree
Showing 9 changed files with 10,224 additions and 71 deletions.
18 changes: 13 additions & 5 deletions socialtasks.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import time import time
import datetime 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 flaskext.sqlalchemy import SQLAlchemy


from models import app, db, Fbuser, Task, Comment from models import app, db, Fbuser, Task, Comment
Expand All @@ -18,7 +18,6 @@


app = Flask(__name__) app = Flask(__name__)


@decorators.memoized
def get_me(): def get_me():
return fb_call('me', args={'access_token': session['access_token']}) return fb_call('me', args={'access_token': session['access_token']})


Expand Down Expand Up @@ -160,6 +159,15 @@ def get_fully_qualified_path(short_path='/'):
else: else:
return 'https://' + request.host + short_path 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']) @app.route('/close/', methods=['GET', 'POST'])
def close(): def close():
Expand Down Expand Up @@ -259,16 +267,16 @@ def make_comment(content=None):
author = me['id'] author = me['id']
creation_time = datetime.datetime.today() creation_time = datetime.datetime.today()
task_id = request.form['task_id'] task_id = request.form['task_id']

comment = Comment(comment_id, task_id, datetime.datetime.today(), author, contents) comment = Comment(comment_id, task_id, datetime.datetime.today(), author, contents)
db.session.add(comment) db.session.add(comment)
db.session.commit() 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>' 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 return to_return
raise Exception raise Exception


@app.route('/task/<t_id>/', methods=['GET']) @app.route('/task/<t_id>/', methods=['GET'])
@ensure_fb_auth @ensure_fb_auth
def view_task(t_id): def view_task(t_id):
Expand Down
8 changes: 4 additions & 4 deletions static/js/create_task.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ $(function () {
success: function(response) { success: function(response) {
$('#create_button').removeAttr('disabled'); $('#create_button').removeAttr('disabled');
$('#main_content').load('ajax/home/'); $('#main_content').load('ajax/home/');
$('#top_create').attr('class', ''); $('#top_create').attr('class', '');
$('#top_mytasks').attr('class', 'active'); $('#top_mytasks').attr('class', 'active');
} }
}); });
}); });
}); });
Loading

0 comments on commit 3ca28ad

Please sign in to comment.