Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

This commit is contained in:
Stephan Porada 2019-09-11 14:53:15 +02:00
commit 0826f6a9f7
3 changed files with 14 additions and 7 deletions

View File

@ -131,9 +131,9 @@ def password_reset(token):
title='Password Reset') title='Password Reset')
@auth.route('/edit_profile', methods=['GET', 'POST']) @auth.route('/settings', methods=['GET', 'POST'])
@login_required @login_required
def edit_profile(): def settings():
""" """
View where loged in User can change own User information like Password etc. View where loged in User can change own User information like Password etc.
""" """
@ -144,7 +144,7 @@ def edit_profile():
db.session.add(current_user) db.session.add(current_user)
db.session.commit() db.session.commit()
flash('Your password has been updated.') flash('Your password has been updated.')
return redirect(url_for('auth.edit_profile')) return redirect(url_for('auth.settings'))
else: else:
flash('Invalid password.') flash('Invalid password.')
change_profile_form = EditProfileForm(user=current_user) change_profile_form = EditProfileForm(user=current_user)
@ -155,10 +155,10 @@ def edit_profile():
flash('Your email has been updated.') flash('Your email has been updated.')
change_profile_form.email.data = current_user.email change_profile_form.email.data = current_user.email
return render_template( return render_template(
'auth/edit_profile.html.j2', 'auth/settings.html.j2',
change_password_form=change_password_form, change_password_form=change_password_form,
change_profile_form=change_profile_form, change_profile_form=change_profile_form,
title='Edit Profile' title='Settings'
) )

View File

@ -72,7 +72,7 @@
</div> </div>
<ul id="nav-account-dropdown" class="dropdown-content"> <ul id="nav-account-dropdown" class="dropdown-content">
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<li><a href="{{ url_for('auth.edit_profile') }}"><i class="material-icons">settings</i>Settings</a></li> <li><a href="{{ url_for('auth.settings') }}"><i class="material-icons">settings</i>Settings</a></li>
<li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li> <li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li>
{% else %} {% else %}
<li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li> <li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li>
@ -102,6 +102,7 @@
<ul id="slide-out" class="sidenav sidenav-fixed"> <ul id="slide-out" class="sidenav sidenav-fixed">
<li><a href="{{ url_for('main.index') }}"><i class="material-icons">opacity</i>Opaque</a></li> <li><a href="{{ url_for('main.index') }}"><i class="material-icons">opacity</i>Opaque</a></li>
<li><a href="#"><i class="material-icons">linear_scale</i>Workflow</a></li>
<li><a href="{{ url_for('main.dashboard') }}"><i class="material-icons">dashboard</i>Dashboard</a></li> <li><a href="{{ url_for('main.dashboard') }}"><i class="material-icons">dashboard</i>Dashboard</a></li>
<li><div class="divider"></div></li> <li><div class="divider"></div></li>
<li><a class="subheader">Services</a></li> <li><a class="subheader">Services</a></li>
@ -116,7 +117,7 @@
<li><div class="divider"></div></li> <li><div class="divider"></div></li>
<li><a class="subheader">Account</a></li> <li><a class="subheader">Account</a></li>
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<li><a href="{{ url_for('auth.edit_profile') }}"><i class="material-icons">settings</i>Settings</a></li> <li><a href="{{ url_for('auth.settings') }}"><i class="material-icons">settings</i>Settings</a></li>
<li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li> <li><a href="{{ url_for('auth.logout') }}"><i class="material-icons">power_settings_new</i>Log out</a></li>
{% else %} {% else %}
<li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li> <li><a href="{{ url_for('auth.login') }}"><i class="material-icons">person</i>Log in</a></li>
@ -193,6 +194,12 @@
document.getElementById("new-job"), document.getElementById("new-job"),
{"coverTrigger": false} {"coverTrigger": false}
); );
var entry;
for (entry of document.querySelectorAll("#slide-out a:not(.subheader)")) {
if (entry.href === window.location.href) {
entry.parentNode.classList.add("active");
}
}
{% for message in get_flashed_messages() %} {% for message in get_flashed_messages() %}
M.toast({html: '{{ message }}'}) M.toast({html: '{{ message }}'})
{% endfor %} {% endfor %}