diff --git a/refstack/static/refstack.css b/refstack/static/refstack.css index fe951674..f183ce18 100755 --- a/refstack/static/refstack.css +++ b/refstack/static/refstack.css @@ -122,3 +122,12 @@ input[name="openid"] { margin-right: 6px; } + +.red{ + color: red; +} + +.green{ + color: #329000; +} + diff --git a/refstack/templates/view_profile.html b/refstack/templates/view_profile.html new file mode 100755 index 00000000..e7337f7f --- /dev/null +++ b/refstack/templates/view_profile.html @@ -0,0 +1,44 @@ +{% extends "layout.html" %} +{% block title %}View Profile{% endblock %} +{% block body %} + +
+
+ {{ user.name }}'s profile + + + + + +
+ + + + + + + + + + +
+ E-Mail: + + {{ user.email }} + {% if user.email_verified %} + + {% else %} + + {% endif %} +
+ Authorized by Vendor: + + {% if user.authorized %} + + {% else %} + + {% endif %} +
+
+ +{% endblock %} diff --git a/refstack/web.py b/refstack/web.py index 84704056..696a9dc0 100755 --- a/refstack/web.py +++ b/refstack/web.py @@ -123,7 +123,7 @@ def create_profile(): 'create_profile.html', next_url=oid.get_next_url()) -@app.route('/profile', methods=['GET', 'POST']) +@app.route('/profile/edit', methods=['GET', 'POST']) def edit_profile(): """Updates a profile""" if g.user is None: @@ -131,8 +131,8 @@ def edit_profile(): form = dict(name=g.user.name, email=g.user.email) if request.method == 'POST': if 'delete' in request.form: - db.session.delete(g.user) - db.session.commit() + db.delete(g.user) + db.commit() session['openid'] = None flash(u'Profile deleted') return redirect(url_for('index')) @@ -146,11 +146,20 @@ def edit_profile(): flash(u'Profile successfully created') g.user.name = form['name'] g.user.email = form['email'] - db.session.commit() + db.commit() return redirect(url_for('edit_profile')) return render_template('edit_profile.html', form=form) +@app.route('/profile', methods=['GET', 'POST']) +def view_profile(): + """Updates a profile""" + if g.user is None: + abort(401) + + return render_template('view_profile.html', user=g.user) + + @app.route('/logout') def logout(): """logout route"""