Added logout

This commit is contained in:
Edgar P. Burkhart 2022-01-28 12:19:37 +01:00
parent b57341448b
commit 71a8646855
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
4 changed files with 38 additions and 4 deletions

View file

@ -33,5 +33,9 @@ def create_app(
'login.html',
failed = failed,
)
@app.route('/logout')
def logout():
flask.session['logged'] = False
return flask.redirect(flask.url_for('home'))
return app

View file

@ -7,10 +7,37 @@ body {
1fr;
}
body > h1 {
body > .topbar {
grid-row: 1;
grid-column: 1 / span 2;
margin: 3rem 3rem 1rem 3rem;
position: relative;
}
.topbar h1 {
margin: 0;
}
.topbar > a {
position: absolute;
top: 0;
right: 0;
color: var(--text-02) !important;
text-decoration: none;
padding: 0 1rem;
line-height: 4rem;
background: none;
cursor: pointer;
}
.topbar > a > i {
vertical-align: top;
}
.topbar > a:hover {
background: var(--hover-ui);
}
.topbar > a:active {
background: var(--active-ui);
}
.topbar > a:focus {
outline: 2px solid var(--focus);
}
body > #events {

View file

@ -88,8 +88,8 @@ a:visited {
a:before {
content: '';
position: absolute;
left: 0;
left: -1rem;
top: -1rem;
bottom: -1rem;
right: 0;
right: -1rem;
}

View file

@ -7,7 +7,10 @@
{% endblock %}
{% block body %}
<h1><img src="/static/svg/logo.svg" /> Saturn</h1>
<div class="topbar">
<h1><img src="/static/svg/logo.svg" /> Saturn</h1>
<a href="/logout"><i class="ri-logout-box-line ri-2x"></i></a>
</div>
<div id="events">
{% for event in events %}