def home(username):
    print("hello")
    if request.method == "POST":
        print("2")
        if(str(request.form["post"]) == "finding"):
            utils.addFriend(username, str(request.form["search_for"]))
        elif (str(request.form["post"])) == "commenting":
            print("1")
            print(str(request.form["id"]))
            print("3")
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("allfriends.html", theposts = utils.showFriendPosts(username), username = username, friendslist = utils.friendList(username), comments = utils.showAllComments())
Example #2
0
def home(username):
    print("hello")
    if request.method == "POST":
        print("2")
        if(str(request.form["post"]) == "finding"):
            utils.addFriend(username, str(request.form["search_for"]))
        elif (str(request.form["post"])) == "commenting":
            print("1")
            print(str(request.form["id"]))
            print("3")
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("allfriends.html", theposts = utils.showFriendPosts(username), username = username, friendslist = utils.friendList(username), comments = utils.showAllComments())
def feed(username):
    print(request.method == "POST")
    if request.method == "POST":
        print("5")
        if(str(request.form["post"]) == "posted"):
            print("2")
            utils.addPost(username, str(request.form["title"]), "sub", str(request.form["paragraph_text"]))
        elif (str(request.form["post"])) == "finding":
            print(str(request.form["search_for"]))
            print("3")
            utils.addFriend(username, str(request.form["search_for"]))
            print(utils.isFriend(username, str(request.form["search_for"])))
        elif (str(request.form["post"])) == "commenting":
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("feed.html", comments = utils.showAllComments(), username = username, compareto = username,  posts = utils.showPosts(username), name = utils.findName(username), info = utils.showInfo(username), friendslist = utils.friendList(username))
Example #4
0
def feed(username):
    print(request.method == "POST")
    if request.method == "POST":
        print("5")
        if(str(request.form["post"]) == "posted"):
            print("2")
            utils.addPost(username, str(request.form["title"]), "sub", str(request.form["paragraph_text"]))
        elif (str(request.form["post"])) == "finding":
            print(str(request.form["search_for"]))
            print("3")
            utils.addFriend(username, str(request.form["search_for"]))
            print(utils.isFriend(username, str(request.form["search_for"])))
        elif (str(request.form["post"])) == "commenting":
            utils.addComment(str(request.form["id"]), username, str(request.form["comments"]))
    return render_template("feed.html", comments = utils.showAllComments(), username = username, compareto = username,  posts = utils.showPosts(username), name = utils.findName(username), info = utils.showInfo(username), friendslist = utils.friendList(username))