From 8093e4bb07f6ac36bde3cd2a3da1d32bf00d9576 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand <benjamin.bertrand@esss.se> Date: Sat, 9 Sep 2017 17:14:31 +0200 Subject: [PATCH] More templates update for bootstrap v4 --- app/templates/404.html | 6 ++---- app/templates/500.html | 6 ++---- app/templates/qrcodes.html | 1 + app/templates/users/login.html | 30 ++++++++++++++++++++++++------ app/templates/users/profile.html | 8 ++++---- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/app/templates/404.html b/app/templates/404.html index 5cd25a0..6d26798 100644 --- a/app/templates/404.html +++ b/app/templates/404.html @@ -1,9 +1,7 @@ {%- extends "base.html" %} -{% block title %}Page Not Found{% endblock %} +{% block title %}Page Not Found - ICS Inventory{% endblock %} {% block main %} - <div class="page-header"> - <h1>Page Not Found</h1> - </div> + <h1>Page Not Found</h1> {%- endblock %} diff --git a/app/templates/500.html b/app/templates/500.html index f3956ba..8be15a0 100644 --- a/app/templates/500.html +++ b/app/templates/500.html @@ -1,9 +1,7 @@ {%- extends "base.html" %} -{% block title %}Internal Server Error{% endblock %} +{% block title %}Internal Server Error - ICS Inventory{% endblock %} {% block main %} - <div class="page-header"> - <h1>Internal Server Error</h1> - </div> + <h1>Internal Server Error</h1> {%- endblock %} diff --git a/app/templates/qrcodes.html b/app/templates/qrcodes.html index 9e51629..3a0bbd1 100644 --- a/app/templates/qrcodes.html +++ b/app/templates/qrcodes.html @@ -19,5 +19,6 @@ </div> {% endfor %} </div> + <hr class="separator"> {% endfor %} {%- endblock %} diff --git a/app/templates/users/login.html b/app/templates/users/login.html index eb454f2..60a6cc5 100644 --- a/app/templates/users/login.html +++ b/app/templates/users/login.html @@ -4,14 +4,32 @@ {% block title %}Login - ICS Inventory{% endblock %} {% block main %} - <div class="col-sm-offset-2 col-sm-3"> - <h1>Login</h1> + <div class="col-sm-offset-2 col-sm-4"> + <h2>Login</h2> <form action="" method="POST" role="form"> + {% if form.errors %} + {% set class_ = "form-control is-invalid" %} + {% else %} + {% set class_ = "form-control" %} + {% endif %} {{ form.hidden_tag() }} - {{ wtf.form_field(form.username) }} - {{ wtf.form_field(form.password) }} - {{ wtf.form_field(form.remember_me) }} - {{ wtf.form_field(form.submit) }} + <div class="form-group"> + {{ form.username.label() }} + {{ form.username(class=class_, required=True, placeholder="ESS username") }} + <div class="invalid-feedback">Invalid Username/Password.</div> + </div> + <div class="form-group"> + {{ form.password.label() }} + {{ form.password(class=class_, required=True) }} + <div class="invalid-feedback">Invalid Username/Password.</div> + </div> + <div class="form-check"> + <label class="form-check-label"> + {{ form.remember_me(class="form-check-input") }} + Remember Me + </label> + </div> + <button type="submit" class="btn btn-primary">Submit</button> </form> </div> {% endblock %} diff --git a/app/templates/users/profile.html b/app/templates/users/profile.html index ebffe04..fc384b0 100644 --- a/app/templates/users/profile.html +++ b/app/templates/users/profile.html @@ -4,9 +4,8 @@ {% block title %}Profile - ICS Inventory{% endblock %} {% block main %} - <div class="page-header"> - <h2>{{ user.username }}</h2> - </div> + <h2>{{ user.username }}</h2> + <dl> <dt>Name</dt> <dd>{{user.name}}</dd> @@ -19,5 +18,6 @@ <dd>{{ token }}</dd> {% endif %} </dl> - <a class="btn btn-default" href="{{ url_for('users.get_token') }}" role="button">Generate Token</a> + + <a class="btn btn-primary" href="{{ url_for('users.get_token') }}" role="button">Generate Token</a> {% endblock %} -- GitLab