Added WebUI
This commit is contained in:
16
Adafruit_Video_Looper/templates/security/_macros.html
Normal file
16
Adafruit_Video_Looper/templates/security/_macros.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% macro render_field_with_errors(field) %}
|
||||
<p>
|
||||
{{ field.label }} {{ field(**kwargs)|safe }}
|
||||
{% if field.errors %}
|
||||
<ul>
|
||||
{% for error in field.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_field(field) %}
|
||||
<p>{{ field(**kwargs)|safe }}</p>
|
||||
{% endmacro %}
|
15
Adafruit_Video_Looper/templates/security/_menu.html
Normal file
15
Adafruit_Video_Looper/templates/security/_menu.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% if security.registerable or security.recoverable or security.confirmable %}
|
||||
<h2>Menu</h2>
|
||||
<ul>
|
||||
<li><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">Login</a></li>
|
||||
{% if security.registerable %}
|
||||
<li><a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">Register</a><br/></li>
|
||||
{% endif %}
|
||||
{% if security.recoverable %}
|
||||
<li><a href="{{ url_for_security('forgot_password') }}">Forgot password</a><br/></li>
|
||||
{% endif %}
|
||||
{% if security.confirmable %}
|
||||
<li><a href="{{ url_for_security('send_confirmation') }}">Confirm account</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
9
Adafruit_Video_Looper/templates/security/_messages.html
Normal file
9
Adafruit_Video_Looper/templates/security/_messages.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{%- with messages = get_flashed_messages(with_categories=true) -%}
|
||||
{% if messages %}
|
||||
<ul class="flashes">
|
||||
{% for category, message in messages %}
|
||||
<li class="{{ category }}">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{%- endwith %}
|
18
Adafruit_Video_Looper/templates/security/login_user.html
Normal file
18
Adafruit_Video_Looper/templates/security/login_user.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends 'admin/master.html' %}
|
||||
{% from "security/_macros.html" import render_field_with_errors, render_field %}
|
||||
{% include "security/_messages.html" %}
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
<div class="row-fluid">
|
||||
<h1>Login</h1>
|
||||
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
|
||||
{{ login_user_form.hidden_tag() }}
|
||||
{{ render_field_with_errors(login_user_form.email) }}
|
||||
{{ render_field_with_errors(login_user_form.password) }}
|
||||
{{ render_field_with_errors(login_user_form.remember) }}
|
||||
{{ render_field(login_user_form.next) }}
|
||||
{{ render_field(login_user_form.submit, class="btn btn-primary") }}
|
||||
</form>
|
||||
{% include "security/_menu.html" %}
|
||||
</div>
|
||||
{% endblock body %}
|
19
Adafruit_Video_Looper/templates/security/register_user.html
Normal file
19
Adafruit_Video_Looper/templates/security/register_user.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends 'admin/master.html' %}
|
||||
{% from "security/_macros.html" import render_field_with_errors, render_field %}
|
||||
{% include "security/_messages.html" %}
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
<div class="row-fluid">
|
||||
<h1>Register</h1>
|
||||
<form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
|
||||
{{ register_user_form.hidden_tag() }}
|
||||
{{ render_field_with_errors(register_user_form.email) }}
|
||||
{{ render_field_with_errors(register_user_form.password) }}
|
||||
{% if register_user_form.password_confirm %}
|
||||
{{ render_field_with_errors(register_user_form.password_confirm) }}
|
||||
{% endif %}
|
||||
{{ render_field(register_user_form.submit, class="btn btn-primary") }}
|
||||
</form>
|
||||
{% include "security/_menu.html" %}
|
||||
</div>
|
||||
{% endblock body %}
|
Reference in New Issue
Block a user