Example #1
0
def timeline(wall_id):
	if wall_id == 0 : wall_id = session['user_id']
	if request.method=='POST' : 
		if 'post-content' in request.form :
			# New Posting
			post_manager.add_post(request.form, wall_id)
		elif 'comment-content' in request.form :
			# New Comment
			comment_manager.add_comment(request.form)	
	return render_timeline(wall_id)
Example #2
0
def write():
    if request.method == 'POST': 
        # if 'secret' in request.form:
        #     secret_temp = 1
        # else :
        #     secret_temp = 0 
        post_manager.add_post(request.form, 'secret' in request.form, session['user_id'], session['wall_id'])
        return redirect(url_for('posts', wall_id = session['wall_id']))
    else:

        return render_template('write.html')
Example #3
0
def write():
    if request.method == 'POST':
        # if secret_post not in request.form :
        # 	is_secret = 0
        # else :
        # is_secret =  1
        body = request.form['body_post']
        user_id = session['user_id']
        wall_id = session['wall_id']
        post_manager.add_post(body, user_id, wall_id)
        return redirect(url_for('timeline', wall_id=session['wall_id']))
    else:
        return render_template("write.html")