Modified the base layout to show the logged in users name
This commit is contained in:
parent
70a5874089
commit
7a8b8b7434
2 changed files with 7 additions and 2 deletions
|
@ -24,7 +24,7 @@ def logout():
|
||||||
if 'zeus_token' in session:
|
if 'zeus_token' in session:
|
||||||
session.pop('zeus_token', None)
|
session.pop('zeus_token', None)
|
||||||
logout_user()
|
logout_user()
|
||||||
return redirect(url_for('admin.index'))
|
return redirect(url_for('home'))
|
||||||
|
|
||||||
|
|
||||||
def before_request():
|
def before_request():
|
||||||
|
|
|
@ -15,7 +15,12 @@
|
||||||
<li><a href="{{ url_for('home') }}">Home</a></li>
|
<li><a href="{{ url_for('home') }}">Home</a></li>
|
||||||
<li><a href="{{ url_for('stats') }}">Stats</a></li>
|
<li><a href="{{ url_for('stats') }}">Stats</a></li>
|
||||||
<li><a href="{{ url_for('about') }}">About</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>
|
<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>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue