Added WebUI
This commit is contained in:
20
Adafruit_Video_Looper/templates/admin/index.html
Normal file
20
Adafruit_Video_Looper/templates/admin/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% extends 'admin/master.html' %}
|
||||
{% block body %}
|
||||
{{ super() }}
|
||||
<div class="row-fluid">
|
||||
|
||||
<div>
|
||||
<h1>Flask-Admin example</h1>
|
||||
<p class="lead">
|
||||
WebUI
|
||||
</p>
|
||||
{% if not current_user.is_authenticated() %}
|
||||
<p>
|
||||
<a class="btn btn-default" href="{{ url_for('security.login') }}">login</a> <a class="btn btn-default" href="{{ url_for('security.register') }}">register</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<a class="btn btn-primary" href="/"><i class="icon-arrow-left icon-white"></i> Back</a>
|
||||
</div>
|
||||
{% endblock body %}
|
7
Adafruit_Video_Looper/templates/index.html
Normal file
7
Adafruit_Video_Looper/templates/index.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
<a href="{{ url_for('admin.index') }}">Go to admin!</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
19
Adafruit_Video_Looper/templates/my_master.html
Normal file
19
Adafruit_Video_Looper/templates/my_master.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends 'admin/base.html' %}
|
||||
|
||||
{% block access_control %}
|
||||
{% if current_user.is_authenticated() %}
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="icon-user"></i>
|
||||
{% if current_user.first_name -%}
|
||||
{{ current_user.first_name }}
|
||||
{% else -%}
|
||||
{{ current_user.email }}
|
||||
{%- endif %} <span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ url_for('security.logout') }}">Log out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
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