aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/templates/base.html4
-rw-r--r--wqflask/wqflask/templates/security/_macros.html13
-rw-r--r--wqflask/wqflask/templates/security/login_user.html59
3 files changed, 60 insertions, 16 deletions
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 69117d89..470ac9db 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -68,10 +68,10 @@
<li class="">
{% if g.identity.name=="anon" %}
<a href="/login" data-remote="/login"
- data-target="#utility" data-toggle="modal">Login</a>
+ data-target="#utility" data-toggle="modal">Sign in</a>
{% else %}
<a href="/logout" data-remote="/logout"
- data-target="#utility" data-toggle="modal">Logout</a>
+ data-target="#utility" data-toggle="modal">Sign out</a>
{% endif %}
</li>
</ul>
diff --git a/wqflask/wqflask/templates/security/_macros.html b/wqflask/wqflask/templates/security/_macros.html
index 919b979a..83f12bf7 100644
--- a/wqflask/wqflask/templates/security/_macros.html
+++ b/wqflask/wqflask/templates/security/_macros.html
@@ -11,6 +11,19 @@
</p>
{% endmacro %}
+{% macro render_only_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 %}
diff --git a/wqflask/wqflask/templates/security/login_user.html b/wqflask/wqflask/templates/security/login_user.html
index b5fcbfdc..76f28094 100644
--- a/wqflask/wqflask/templates/security/login_user.html
+++ b/wqflask/wqflask/templates/security/login_user.html
@@ -1,17 +1,48 @@
-{% from "security/_macros.html" import render_field_with_errors, render_field %}
+{% from "security/_macros.html" import render_only_errors %}
{% include "security/_messages.html" %}
-<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) }}
-
- {% if security.recoverable %}
- <a href="{{ url_for_security('forgot_password') }}">Forgot your password?</a><br/>
- {% endif %}
-
- {{ render_field_with_errors(login_user_form.remember) }}
- {{ render_field(login_user_form.next) }}
- {{ render_field(login_user_form.submit) }}
+
+<form class="form-horizontal" action="{{ url_for_security('login') }}"
+ method="POST" name="login_user_form">
+ {{ login_user_form.hidden_tag() }}
+ <fieldset>
+ <legend>
+ Sign in
+ </legend>
+
+ <div class="control-group">
+ <label class="control-label" for="email">Email Address</label>
+ <div class="controls">
+ <input id="email" name="email" type="text" value="">
+ </div>
+ {{ render_only_errors(login_user_form.email) }}
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="password">Password</label>
+ <div class="controls">
+ <input id="password" name="password" type="password" value="">
+
+ {{ render_only_errors(login_user_form.password) }}
+ {% if security.recoverable %}
+
+ <a href="{{ url_for_security('forgot_password') }}">Forgot your password?</a><br/>
+ </div>
+ {% endif %}
+
+ </div>
+
+
+ <div class="control-group">
+ <div class="controls">
+ <label class="checkbox">
+ <input id="remember" name="remember" type="checkbox" value="y"> Remember me
+ </label>
+
+ <input id="next" name="next" type="hidden" value="">
+
+ <input class="btn" id="submit" name="submit" type="submit" value="Sign in">
+ </div>
+ </fieldset>
+
</form>
<!--{% include "security/_menu.html" %}-->