diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2016-01-25 00:15:12 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2016-02-02 04:22:16 +0100 |
commit | 7619809115e6fdc3d7df8705abb20f228863e7c2 (patch) | |
tree | 5afaeeb9020d418143b7cea3e1e2540efcc2140e /accounts/templates | |
parent | 753c03b3477071279299ca47ce76f5fcd346d5bd (diff) | |
download | web-7619809115e6fdc3d7df8705abb20f228863e7c2.tar.gz web-7619809115e6fdc3d7df8705abb20f228863e7c2.tar.bz2 web-7619809115e6fdc3d7df8705abb20f228863e7c2.zip |
Use Flask-Login for login handling
Diffstat (limited to 'accounts/templates')
-rw-r--r-- | accounts/templates/base.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/accounts/templates/base.html b/accounts/templates/base.html index 1eeda55..f59408d 100644 --- a/accounts/templates/base.html +++ b/accounts/templates/base.html @@ -15,9 +15,15 @@ <div id="header-background"> </div> <header> - <h1><a href="{{ url_for('default.settings') if g.user else url_for('default.index') }}"> - <img src="{{ url_for('static', filename='logo.png') }}" alt="spline accounts" /> - </a></h1> + <h1> + {%- if current_user.is_authenticated -%} + <a href="{{ url_for('default.settings') }}"> + {%- else -%} + <a href="{{ url_for('default.index') }}"> + {%- endif -%} + <img src="{{ url_for('static', filename='logo.png') }}" alt="spline accounts" /> + </a> + </h1> <span id="roundcornerb"> </span> <span id="roundcornerw"> </span> @@ -31,9 +37,9 @@ {%- if not no_login_message %} <nav id="usermenu"> <ul> - {%- if g.user %} - <li>Angemeldet als <strong>{{ g.user.uid }}</strong></li> - {%- if g.user.uid in config.get('ADMIN_USERS', []) %} + {%- if current_user.is_authenticated %} + <li>Angemeldet als <strong>{{ current_user.uid }}</strong></li> + {%- if current_user.uid in config.get('ADMIN_USERS', []) %} <li><a href="{{ url_for('admin.index') }}">Admin</a></li> {%- endif %} <li><a href="{{ url_for('default.logout') }}">Abmelden</a></li> |