diff options
Diffstat (limited to 'flaskr/templates')
| -rw-r--r-- | flaskr/templates/auth/login.html | 15 | ||||
| -rw-r--r-- | flaskr/templates/auth/register.html | 15 | ||||
| -rw-r--r-- | flaskr/templates/base.html | 25 |
3 files changed, 55 insertions, 0 deletions
diff --git a/flaskr/templates/auth/login.html b/flaskr/templates/auth/login.html new file mode 100644 index 0000000..b7dd5dc --- /dev/null +++ b/flaskr/templates/auth/login.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} + +{% block header %} + <h1>{% block title %}Log In{% 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="Log In"> + </form> +{% endblock %}
\ No newline at end of file diff --git a/flaskr/templates/auth/register.html b/flaskr/templates/auth/register.html new file mode 100644 index 0000000..a3c73cc --- /dev/null +++ b/flaskr/templates/auth/register.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} + +{% 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="Register"> + </form> +{% endblock %}
\ No newline at end of file diff --git a/flaskr/templates/base.html b/flaskr/templates/base.html new file mode 100644 index 0000000..6ea4864 --- /dev/null +++ b/flaskr/templates/base.html @@ -0,0 +1,25 @@ +<!doctype html> +<title>{% block title %}{% endblock %} - Flaskr</title> +<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> +<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> +<nav> + <h1><a href="{{ url_for('index') }}">Flaskr</a></h1> + <ul> + {% if g.user %} + <li><span>{{ g.user['username'] }}</span> + <li><a href="{{ url_for('auth.logout') }}">Log Out</a> + {% else %} + <li><a href="{{ url_for('auth.register') }}">Register</a> + <li><a href="{{ url_for('auth.login') }}">Log In</a> + {% endif %} + </ul> +</nav> +<section class="content"> + <header> + {% block header %}{% endblock %} + </header> + {% for message in get_flashed_messages() %} + <div class="flash">{{ message }}</div> + {% endfor %} + {% block content %}{% endblock %} +</section>
\ No newline at end of file |
