summaryrefslogtreecommitdiffhomepage
path: root/apioforum/templates
diff options
context:
space:
mode:
Diffstat (limited to 'apioforum/templates')
-rw-r--r--apioforum/templates/auth/login.html.j22
-rw-r--r--apioforum/templates/auth/register.html.j214
-rw-r--r--apioforum/templates/base.html.j213
3 files changed, 28 insertions, 1 deletions
diff --git a/apioforum/templates/auth/login.html.j2 b/apioforum/templates/auth/login.html.j2
index 5f311cf..c8c67b4 100644
--- a/apioforum/templates/auth/login.html.j2
+++ b/apioforum/templates/auth/login.html.j2
@@ -8,7 +8,7 @@
<label for="username">Username</label>
<input name="username" id="username" required>
<label for="password">Password</label>
- <input name="password" id="password" required>
+ <input type="password" name="password" id="password" required>
<input type="submit" value="yes">
</form>
{% endblock %}
diff --git a/apioforum/templates/auth/register.html.j2 b/apioforum/templates/auth/register.html.j2
new file mode 100644
index 0000000..f7eab81
--- /dev/null
+++ b/apioforum/templates/auth/register.html.j2
@@ -0,0 +1,14 @@
+{% extends "base.html.j2" %}
+{% block header %}
+ <h1>{% block title %}register{% endblock %}</h1>
+{% endblock %}
+
+{% block content %}
+<form method="post">
+ <label for="username">Username</label>
+ <input name="username" id="username" required>
+ <label for="password">Password</label>
+ <input type="password" name="password" id="password" required>
+ <input type="submit" value="yes">
+</form>
+{% endblock %}
diff --git a/apioforum/templates/base.html.j2 b/apioforum/templates/base.html.j2
index 01339c1..6660686 100644
--- a/apioforum/templates/base.html.j2
+++ b/apioforum/templates/base.html.j2
@@ -6,6 +6,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
+ <nav>
+ <h1>apioforum</h1>
+ <ul>
+ {% if g.user %}
+ <li>{{ g.user['username'] }}</li>
+ <li><a href="{{ url_for('auth.logout') }}">logout</a></li>
+ {% else %}
+ <li><a href="{{ url_for('auth.login') }}">login</a></li>
+ <li><a href="{{ url_for('auth.register') }}">register</a></li>
+ {% endif %}
+ </ul>
+ </nav>
+
{% block header %}{% endblock %}
{% for msg in get_flashed_messages() %}
<div class="flash">{{ msg }}</div>