From c2080606d8822e21edaad627d7deda1f114aa003 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 May 2013 21:52:37 +0000 Subject: Sign in template looking pretty good --- wqflask/wqflask/templates/base.html | 4 +- wqflask/wqflask/templates/security/_macros.html | 13 +++++ wqflask/wqflask/templates/security/login_user.html | 59 +++++++++++++++++----- 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 @@
  • {% if g.identity.name=="anon" %} Login + data-target="#utility" data-toggle="modal">Sign in {% else %} Logout + data-target="#utility" data-toggle="modal">Sign out {% endif %}
  • 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 @@

    {% endmacro %} +{% macro render_only_errors(field) %} +

    + + {% if field.errors %} +

    + {% endif %} +

    +{% endmacro %} + {% macro render_field(field) %}

    {{ field(**kwargs)|safe }}

    {% 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" %} -

    Login

    -
    - {{ login_user_form.hidden_tag() }} - {{ render_field_with_errors(login_user_form.email) }} - {{ render_field_with_errors(login_user_form.password) }} - - {% if security.recoverable %} - Forgot your password?
    - {% endif %} - - {{ render_field_with_errors(login_user_form.remember) }} - {{ render_field(login_user_form.next) }} - {{ render_field(login_user_form.submit) }} + + + {{ login_user_form.hidden_tag() }} +
    + + Sign in + + +
    + +
    + +
    + {{ render_only_errors(login_user_form.email) }} +
    + +
    + +
    + + + {{ render_only_errors(login_user_form.password) }} + {% if security.recoverable %} + + Forgot your password?
    +
    + {% endif %} + +
    + + +
    +
    + + + + + +
    +
    +
    -- cgit v1.2.3