summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMarian Sigler <m@qjym.de>2012-09-19 23:40:17 +0200
committerMarian Sigler <m@qjym.de>2012-09-19 23:40:17 +0200
commit519384f4f2b51ef1db31b9d7b13123da1fd7e779 (patch)
tree562710c6c9feeea2c18587b96a591f8f305bd0e7 /templates
parent388c94deb866fdc9e25de31728ecdadecf4e5785 (diff)
downloadweb-519384f4f2b51ef1db31b9d7b13123da1fd7e779.tar.gz
web-519384f4f2b51ef1db31b9d7b13123da1fd7e779.tar.bz2
web-519384f4f2b51ef1db31b9d7b13123da1fd7e779.zip
login works now.
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html20
-rw-r--r--templates/index.html4
-rw-r--r--templates/login.html0
3 files changed, 24 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
index 6e4e403..decff78 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -12,7 +12,27 @@
{%- endfor %}
</head>
<body>
+
<h1>{% if title %}{{ title }}{% else %}spline accounts{% endif %}</h1>
+
+ {%- if session.username %}
+ <p>Logged in as {{ session.username }}. <a href="{{ url_for('logout') }}">Log out</a></p>
+ {%- else %}
+ <p>Not logged in. <a href="{{ url_for('index') }}">Log in</a></p>
+ {%- endif %}
+
+ {% with messages = get_flashed_messages() %}
+ {% if messages %}
+ <ul class=flashes>
+ {% for message in messages %}
+ <li>{{ message }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% endwith %}
+
{% block content %}{% endblock %}
+
+ <pre>{{ session.__repr__() }}</pre>
</body>
</html>
diff --git a/templates/index.html b/templates/index.html
index 74ffb6b..cb9c238 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,10 +2,14 @@
{%- from '_macros.html' import render_field %}
{%- block content %}
<p>Willkommen bei <strong>spline accounts</strong>!</p>
+{%- if session.username %}
+<p>Hallo {{ session.username }}. <a href="{{ url_for('settings') }}">Einstellungen</a></p>
+{%- else %}
<p><a href="/register">Account erstellen</a></p>
<form action="" method="post">
{{ render_field(form.username) }}
{{ render_field(form.password) }}
<input type="submit" value="Login" />
</form>
+{%- endif %}
{%- endblock %}
diff --git a/templates/login.html b/templates/login.html
deleted file mode 100644
index e69de29..0000000
--- a/templates/login.html
+++ /dev/null