From 1b505d0f3956f7a87b75ed27a69c2c2e6fc147ab Mon Sep 17 00:00:00 2001
From: Matt Wright
Date: Wed, 15 Aug 2012 19:22:06 -0400
Subject: [PATCH] Update default templates
---
.../templates/security/confirmations/new.html | 5 +++--
.../templates/security/logins/new.html | 11 ++++++-----
.../templates/security/logins/passwordless.html | 7 ++++---
flask_security/templates/security/macros.html | 16 ++++++++++++++++
.../templates/security/passwords/edit.html | 7 ++++---
.../templates/security/passwords/new.html | 5 +++--
.../templates/security/registrations/edit.html | 13 +++++++------
.../templates/security/registrations/new.html | 9 +++++----
8 files changed, 48 insertions(+), 25 deletions(-)
create mode 100644 flask_security/templates/security/macros.html
diff --git a/flask_security/templates/security/confirmations/new.html b/flask_security/templates/security/confirmations/new.html
index 7bece48..e3e523c 100644
--- a/flask_security/templates/security/confirmations/new.html
+++ b/flask_security/templates/security/confirmations/new.html
@@ -1,7 +1,8 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Resend confirmation instructions
\ No newline at end of file
diff --git a/flask_security/templates/security/logins/new.html b/flask_security/templates/security/logins/new.html
index f5d9998..a81d1fe 100644
--- a/flask_security/templates/security/logins/new.html
+++ b/flask_security/templates/security/logins/new.html
@@ -1,10 +1,11 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Login
\ No newline at end of file
diff --git a/flask_security/templates/security/logins/passwordless.html b/flask_security/templates/security/logins/passwordless.html
index ee49871..d0f353e 100644
--- a/flask_security/templates/security/logins/passwordless.html
+++ b/flask_security/templates/security/logins/passwordless.html
@@ -1,8 +1,9 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Login
\ No newline at end of file
diff --git a/flask_security/templates/security/macros.html b/flask_security/templates/security/macros.html
new file mode 100644
index 0000000..8575f3d
--- /dev/null
+++ b/flask_security/templates/security/macros.html
@@ -0,0 +1,16 @@
+{% macro render_field_with_errors(field) %}
+
+ {{ field.label }} {{ field(**kwargs)|safe }}
+ {% if field.errors %}
+
+ {% for error in field.errors %}
+ - {{ error }}
+ {% endfor %}
+
+ {% endif %}
+
+{% endmacro %}
+
+{% macro render_field(field) %}
+ {{ field(**kwargs)|safe }}
+{% endmacro %}
\ No newline at end of file
diff --git a/flask_security/templates/security/passwords/edit.html b/flask_security/templates/security/passwords/edit.html
index e806d0d..4a505be 100644
--- a/flask_security/templates/security/passwords/edit.html
+++ b/flask_security/templates/security/passwords/edit.html
@@ -1,8 +1,9 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Change password
\ No newline at end of file
diff --git a/flask_security/templates/security/passwords/new.html b/flask_security/templates/security/passwords/new.html
index c5b2a93..31c4f1f 100644
--- a/flask_security/templates/security/passwords/new.html
+++ b/flask_security/templates/security/passwords/new.html
@@ -1,7 +1,8 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Send reset password instructions
\ No newline at end of file
diff --git a/flask_security/templates/security/registrations/edit.html b/flask_security/templates/security/registrations/edit.html
index de100f7..0d5c637 100644
--- a/flask_security/templates/security/registrations/edit.html
+++ b/flask_security/templates/security/registrations/edit.html
@@ -1,10 +1,11 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
-Edit account
+Edit Account
\ No newline at end of file
diff --git a/flask_security/templates/security/registrations/new.html b/flask_security/templates/security/registrations/new.html
index 133f5d8..b9f9773 100644
--- a/flask_security/templates/security/registrations/new.html
+++ b/flask_security/templates/security/registrations/new.html
@@ -1,9 +1,10 @@
+{% from "security/macros.html" import render_field_with_errors, render_field %}
{% include "security/messages.html" %}
Register
\ No newline at end of file