summaryrefslogtreecommitdiff
path: root/templates/index.html
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-06-04 13:05:23 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-06-04 13:05:23 +0200
commit3da927e56c24379428b35c2ba07d4acd9305ce98 (patch)
treeb8df69186020361c9b43b12beff0781b5afb71ec /templates/index.html
parent5e9cb8f08b8fac65b466118a8590628d911db987 (diff)
downloadjokevote-3da927e56c24379428b35c2ba07d4acd9305ce98.tar.gz
jokevote-3da927e56c24379428b35c2ba07d4acd9305ce98.zip
implement user management
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html48
1 files changed, 47 insertions, 1 deletions
diff --git a/templates/index.html b/templates/index.html
index 79609f8..1a47405 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -11,7 +11,53 @@
<script type="text/javascript" src="/static/jquery.min.js"></script>
<script type="text/javascript" src="/static/materialize.min.js"></script>
<div class="container">
- <h3>Lehrersprüche</h3>
+ <div class="row">
+ <div class="col s12 m6">
+ <h3>Lehrersprüche</h3>
+ </div>
+ <div class="col s12 m6 row">
+ {% if user.loggedin %}
+ <div class="col s12 m4 offset-m8 row valign-wrapper">
+ <div class="col s6 m12">
+ <p class="chip">{{ user.name }}</p>
+ </div>
+ <div class="col s6 m12 valign">
+ <form action="/logout" method="post">
+ <input type="hidden" name="redirpage" value="{{ currentpage }}">
+ <button class="btn" type="submit">Logout</button>
+ </form>
+ </div>
+ </div>
+ {% else %}
+ <form action="/login" method="post">
+ <input type="hidden" name="redirpage" value="{{ currentpage }}">
+ <div class="col s6 input-field">
+ <label for="user">Benutzer</label>
+ <input type="text" name="user">
+ </div>
+ <div class="col s6 input-field">
+ <label for="user">Passwort</label>
+ <input type="password" name="password">
+ </div>
+ <div class="col s6">
+ <button class="btn" type="submit" name="action" value="login">Login</button>
+ </div>
+ <div class="col s6">
+ <button class="btn" type="submit" name="action" value="register">Anmelden</button>
+ </div>
+ </form>
+ {% endif %}
+ {% with msgs = get_flashed_messages() %}
+ {% if msgs %}
+ <div class="col s12 row">
+ {% for msg in msgs %}
+ <p>{{ msg }}</p>
+ {% endfor %}
+ </div>
+ {% endif %}
+ {% endwith %}
+ </div>
+ </div>
<div class="divider"></div>
{% for joke in jokes %}
<div class="row section valign-wrapper">