Modified the base layout to show the logged in users name

This commit is contained in:
Feliciaan De Palmenaer 2015-03-26 23:31:13 +01:00
parent 70a5874089
commit 7a8b8b7434
2 changed files with 7 additions and 2 deletions

View file

@ -24,7 +24,7 @@ def logout():
if 'zeus_token' in session:
session.pop('zeus_token', None)
logout_user()
return redirect(url_for('admin.index'))
return redirect(url_for('home'))
def before_request():

View file

@ -15,7 +15,12 @@
<li><a href="{{ url_for('home') }}">Home</a></li>
<li><a href="{{ url_for('stats') }}">Stats</a></li>
<li><a href="{{ url_for('about') }}">About</a></li>
{% if current_user.is_anonymous() %}
<li><a href="{{ url_for('login') }}">Login</a></li>
{% else %}
<li><a href="{{ url_for('logout') }}">Logout</a></li>
<li>{{ current_user.username }}</li>
{% endif %}
</ul>
</nav>
</div>