diff --git a/nyaa/routes.py b/nyaa/routes.py index 8e20773..5b808ca 100644 --- a/nyaa/routes.py +++ b/nyaa/routes.py @@ -462,7 +462,7 @@ def profile(): return flask.redirect('/profile') user.email = form.email.data flask.flash(flask.Markup( - 'Email successfully changed!'), 'info') + 'Email successfully changed!'), 'success') if new_password: if form.current_password.data != user.password_hash: flask.flash(flask.Markup( @@ -470,7 +470,7 @@ def profile(): return flask.redirect('/profile') user.password_hash = form.new_password.data flask.flash(flask.Markup( - 'Password successfully changed!'), 'info') + 'Password successfully changed!'), 'success') db.session.add(user) db.session.commit() @@ -478,9 +478,11 @@ def profile(): flask.g.user = user return flask.redirect('/profile') - current_email = models.User.by_id(flask.g.user.id).email - - return flask.render_template('profile.html', form=form, email=current_email, level=level) + _user = models.User.by_id(flask.g.user.id) + username = _user.username + current_email = _user.email + + return flask.render_template('profile.html', form=form, name=username, email=current_email, level=level) @app.route('/user/activate/') diff --git a/nyaa/templates/profile.html b/nyaa/templates/profile.html index f07d0a5..827d11f 100644 --- a/nyaa/templates/profile.html +++ b/nyaa/templates/profile.html @@ -3,7 +3,20 @@ {% block body %} {% from "_formhelpers.html" import render_field %} -

Edit Profile

+

Profile of {{ name }}

+ +
+ +
+
+
User ID:
{{ g.user.id }}
+
User Class:
{{ level }}
+
User Created on:
{{ g.user.created_time }}
+
+
+
+
@@ -35,7 +46,6 @@ {{ render_field(form.password_confirm, class_='form-control', placeholder='New password (confirm)') }}
-
@@ -62,7 +72,6 @@ {{ render_field(form.current_password, class_='form-control', placeholder='Current password') }}
-
@@ -70,16 +79,8 @@
-
-
-
User ID:
-
{{g.user.id}}
-
Account created on:
-
{{g.user.created_time}}
-
User class:
-
{{level}}

-
-
+
+ {% endblock %}