diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_macros.html | 16 | ||||
-rw-r--r-- | templates/base.html | 18 | ||||
-rw-r--r-- | templates/index.html | 5 | ||||
-rw-r--r-- | templates/register.html | 12 |
4 files changed, 51 insertions, 0 deletions
diff --git a/templates/_macros.html b/templates/_macros.html new file mode 100644 index 0000000..2c933be --- /dev/null +++ b/templates/_macros.html @@ -0,0 +1,16 @@ +{% macro render_field(field) %} + <dt>{{ field.label }} + <dd>{{ field(**kwargs)|safe }} + {% if field.errors|length == 1 %} + <div class="errors"> + {{ field.errors.0 }} + </div> + {% elif field.errors %} + <ul class="errors"> + {% for error in field.errors %} + <li>{{ error }}</li> + {% endfor %} + </ul> + {% endif %} + </dd> +{% endmacro %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..6e4e403 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,18 @@ +{%- set styles = ['layout.css'] + styles|default([]) %} +{%- set scripts = [] + scripts|default([]) %} +<!doctype html> +<html> + <head> + <title>{% if title %}{{ title }} – {% endif %}spline accounts</title> + {%- for script in scripts %} + <script type="text/javascript" src="{{ url_for('static', filename=script) }}"></script> + {%- endfor %} + {%- for style in styles %} + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename=style) }}"> + {%- endfor %} + </head> + <body> + <h1>{% if title %}{{ title }}{% else %}spline accounts{% endif %}</h1> + {% block content %}{% endblock %} + </body> +</html> diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..9ee3b0f --- /dev/null +++ b/templates/index.html @@ -0,0 +1,5 @@ +{%- extends 'base.html' %} +{%- block content %} + <p>Willkommen bei <strong>spline accounts</strong>!</p> + <p><a href="/register">Account erstellen</a></p> +{%- endblock %} diff --git a/templates/register.html b/templates/register.html new file mode 100644 index 0000000..094056e --- /dev/null +++ b/templates/register.html @@ -0,0 +1,12 @@ +{%- extends 'base.html' %} +{%- from '_macros.html' import render_field %} +{%- set title = 'Account erstellen' %} +{%- block content %} +<form action="" method="post"> + {{ render_field(form.username) }} + {{ render_field(form.mail) }} + {{ render_field(form.password) }} + {{ render_field(form.password_confirm) }} + <input type="submit" value="Registrieren" /> +</form> +{%- endblock %} |