Example #1
0
def mentor_page(linkedin_id):
    ment_data = search.mentor_detail_display(linkedin_id)
    user_data = search.mentor_detail_display(session["linkedin_id"])
    endorsement_history = endorsements.get_endorsement_info_per_mentor(linkedin_id)

    return render_template(
        "mentor_detail.html", ment_data=ment_data, user_data=user_data, endorsement_history=endorsement_history
    )
Example #2
0
def add_endorsement():
    sender = session["linkedin_id"]
    sender_data = search.mentor_detail_display(sender)

    mentor = request.form.get("mentor_id")
    print "~~~~~~~~~~~~~~~~MENTOR ID on main"
    print mentor
    mentor_data = search.mentor_detail_display(mentor)

    endorsement_title = request.form.get("endorsement_title")
    endorsement_body = request.form.get("endorsement_txt")

    endorsements.save_endorsement_info_to_database(sender, mentor, endorsement_title, endorsement_body)

    return redirect(url_for("mentor_page", linkedin_id=mentor))
Example #3
0
def self_page():
    if "linkedin_id" in session:
        ment_data = search.mentor_detail_display(session["linkedin_id"])
        profile_endorsement_hist = endorsements.get_endorsement_info_for_self()
        return render_template(
            "self_profile.html", ment_data=ment_data, profile_endorsement_hist=profile_endorsement_hist
        )
    return redirect(url_for("login"))
Example #4
0
def email_post():
    sender = session["linkedin_id"]
    sender_data = search.mentor_detail_display(sender)
    sender_email = sender_data.email

    mentor = request.form.get("mentor_id")
    mentor_data = search.mentor_detail_display(mentor)
    mentor_email = mentor_data.email

    subject = request.form.get("subject")
    subject_body = request.form.get("message")

    email_module.save_email_info_to_database(sender, mentor, subject, subject_body)
    email_module.send_email(sender_email, mentor_email, subject, subject_body)

    messages = flash("Success! Your message has been sent successfully.")

    return redirect(url_for("email_get", linkedin_id=mentor, messages=messages))
Example #5
0
def mentor_page_update():
    if "linkedin_id" in session:
        ment_data = search.mentor_detail_display(session["linkedin_id"])
        ment_pers_topics = search.mentor_personal_topics(session["linkedin_id"])
        topics = tabledef.Topic.query.order_by("topic_id").all()
        return render_template(
            "edit_self_profile.html", ment_data=ment_data, ment_pers_topics=ment_pers_topics, topics=topics
        )
    return redirect(url_for("login"))
Example #6
0
def email_sent_history():
    user_data = search.mentor_detail_display(session["linkedin_id"])
    email_history = email_module.get_sent_email_history_per_sender()
    return render_template("email_sent_history.html", user_data=user_data, email_history=email_history)
Example #7
0
def email_get(linkedin_id):
    ment_data = search.mentor_detail_display(linkedin_id)
    user_data = search.mentor_detail_display(session["linkedin_id"])
    email_history = email_module.get_email_history_per_mentor(linkedin_id)
    return render_template("email_form.html", ment_data=ment_data, user_data=user_data, email_history=email_history)
Example #8
0
def update_self_page():
    if "linkedin_id" in session:
        ment_data = search.mentor_detail_display(session["linkedin_id"])
        update_data = tabledef.update_linkedin_user()
        return render_template("self_profile.html", ment_data=ment_data)
    return redirect(url_for("self_page"))