From caddbb695cc81be96863704dac425833d1c009d8 Mon Sep 17 00:00:00 2001 From: Patsy Date: Mon, 20 Jul 2026 20:26:26 +0200 Subject: [PATCH] Phase 7: templates --- templates/auth/login.html | 23 ++++++++++++++++++++++ templates/auth/register.html | 29 ++++++++++++++++++++++++++++ templates/base.html | 37 ++++++++++++++++++++++++++++++++++++ templates/index.html | 9 +++++++++ 4 files changed, 98 insertions(+) diff --git a/templates/auth/login.html b/templates/auth/login.html index e69de29..35adec8 100644 --- a/templates/auth/login.html +++ b/templates/auth/login.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} +{% block title %}Log In{% endblock %} +{% block content %} +

Log In

+
+ {{ form.hidden_tag() }} +
+ {{ form.email.label(class="form-label") }} + {{ form.email(class="form-control") }} + {% for error in form.email.errors %}
{{ error }}
{% endfor %} +
+
+ {{ form.password.label(class="form-label") }} + {{ form.password(class="form-control") }} + {% for error in form.password.errors %}
{{ error }}
{% endfor %} +
+
+ {{ form.remember_me(class="form-check-input") }} + {{ form.remember_me.label(class="form-check-label") }} +
+ {{ form.submit(class="btn btn-primary") }} +
+{% endblock %} diff --git a/templates/auth/register.html b/templates/auth/register.html index e69de29..86d6e1c 100644 --- a/templates/auth/register.html +++ b/templates/auth/register.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{% block title %}Register{% endblock %} +{% block content %} +

Create Account

+
+ {{ form.hidden_tag() }} +
+ {{ form.username.label(class="form-label") }} + {{ form.username(class="form-control") }} + {% for error in form.username.errors %}
{{ error }}
{% endfor %} +
+
+ {{ form.email.label(class="form-label") }} + {{ form.email(class="form-control") }} + {% for error in form.email.errors %}
{{ error }}
{% endfor %} +
+
+ {{ form.password.label(class="form-label") }} + {{ form.password(class="form-control") }} + {% for error in form.password.errors %}
{{ error }}
{% endfor %} +
+
+ {{ form.confirm_password.label(class="form-label") }} + {{ form.confirm_password(class="form-control") }} + {% for error in form.confirm_password.errors %}
{{ error }}
{% endfor %} +
+ {{ form.submit(class="btn btn-primary") }} +
+{% endblock %} diff --git a/templates/base.html b/templates/base.html index e69de29..92acdea 100644 --- a/templates/base.html +++ b/templates/base.html @@ -0,0 +1,37 @@ + + + + + + {% block title %}MyApp{% endblock %} + + + + + +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
{{ message }}
+ {% endfor %} + {% endif %} + {% endwith %} + + {% block content %}{% endblock %} +
+ + diff --git a/templates/index.html b/templates/index.html index e69de29..dc58f49 100644 --- a/templates/index.html +++ b/templates/index.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} +{% block title %}Home{% endblock %} +{% block content %} +

Welcome{% if current_user.is_authenticated %}, {{ current_user.username }}{% endif %}!

+ {% if not current_user.is_authenticated %} +

Please log in or + create an account.

+ {% endif %} +{% endblock %}