From b2bbdbfc84764d59f45c2a0f028b65843523b698 Mon Sep 17 00:00:00 2001
From: Serghei Mihai <smihai@entrouvert.com>
Date: Tue, 25 Feb 2020 09:31:45 +0100
Subject: [PATCH] templates: use with_template template tag to render forms
 (#40159)

---
 src/authentic2/templates/authentic2/change_email.html         | 4 ++--
 src/authentic2/templates/authentic2/login_password_form.html  | 4 ++--
 .../authentic2/login_password_registration_form.html          | 4 ++--
 .../templates/registration/password_change_form.html          | 4 ++--
 .../templates/registration/password_reset_confirm.html        | 4 ++--
 .../templates/registration/password_reset_form.html           | 4 ++--
 .../templates/registration/registration_completion_form.html  | 4 ++--
 .../templates/authentic2_auth_fc/unlink.html                  | 4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/authentic2/templates/authentic2/change_email.html b/src/authentic2/templates/authentic2/change_email.html
index ecdd09f4..5fd0f4d6 100644
--- a/src/authentic2/templates/authentic2/change_email.html
+++ b/src/authentic2/templates/authentic2/change_email.html
@@ -1,5 +1,5 @@
 {% extends "authentic2/base-page.html" %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block page-title %}
   {{ block.super }} - {{ view.title }}
@@ -16,7 +16,7 @@
   An email will be sent to validate the new one.{% endblocktrans %}</p>
   <form method="post">
     {% csrf_token %}
-    {{ form.as_p }}
+    {{ form|with_template }}
     <button class="submit-button">{% trans "Validate" %}</button>
     <button class="cancel-button" name="cancel" formnovalidate>{% trans "Cancel" %}</button>
   </form>
diff --git a/src/authentic2/templates/authentic2/login_password_form.html b/src/authentic2/templates/authentic2/login_password_form.html
index 549be9c8..e737e1cc 100644
--- a/src/authentic2/templates/authentic2/login_password_form.html
+++ b/src/authentic2/templates/authentic2/login_password_form.html
@@ -1,4 +1,4 @@
-{% load i18n staticfiles %}
+{% load i18n staticfiles gadjo %}
 
 {% block login %}
 
@@ -6,7 +6,7 @@
 <div>
 <form method="post" action="">
 {% csrf_token %}
-{{ form.as_p }}
+{{ form|with_template }}
 {% block buttons %}
 <button class="submit-button" name="{{ submit_name }}">{% trans "Log in" %}</button>
 {% if cancel %}
diff --git a/src/authentic2/templates/authentic2/login_password_registration_form.html b/src/authentic2/templates/authentic2/login_password_registration_form.html
index d407896e..31a4c6e0 100644
--- a/src/authentic2/templates/authentic2/login_password_registration_form.html
+++ b/src/authentic2/templates/authentic2/login_password_registration_form.html
@@ -1,9 +1,9 @@
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block registration %}
 <form enctype="multipart/form-data" method="post">
   {% csrf_token %}
-  {{ form.as_p }}
+  {{ form|with_template }}
   <button class="submit-button">{% trans 'Submit' %}</button>
 </form>
 {% endblock %}
diff --git a/src/authentic2/templates/registration/password_change_form.html b/src/authentic2/templates/registration/password_change_form.html
index 6314a25c..adef66c5 100644
--- a/src/authentic2/templates/registration/password_change_form.html
+++ b/src/authentic2/templates/registration/password_change_form.html
@@ -1,5 +1,5 @@
 {% extends "authentic2/base-page.html" %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block page-title %}
   {{ block.super }} - {{ view.title }}
@@ -21,7 +21,7 @@
     <p>{% blocktrans %}You are going to define your account password.{% endblocktrans %}</p>
     {% endif %}
     {% csrf_token %}
-    {{ form.as_p }}
+    {{ form|with_template }}
     <button class="submit-button">{% trans 'Submit' %}</button>
     <button class="cancel-button" name="cancel" formnovalidate>{% trans "Cancel" %}</button>
   </form>
diff --git a/src/authentic2/templates/registration/password_reset_confirm.html b/src/authentic2/templates/registration/password_reset_confirm.html
index b713d8fe..20ff9cb4 100644
--- a/src/authentic2/templates/registration/password_reset_confirm.html
+++ b/src/authentic2/templates/registration/password_reset_confirm.html
@@ -1,5 +1,5 @@
 {% extends "authentic2/base-page.html" %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block title %}
 {{ view.title }}
@@ -11,7 +11,7 @@
 
 <form method="post">
   {% csrf_token %}
-  {{ form.as_p }}
+  {{ form|with_template }}
 
   <button class="submit-button">{% trans 'Submit' %}</button>
 </form>
diff --git a/src/authentic2/templates/registration/password_reset_form.html b/src/authentic2/templates/registration/password_reset_form.html
index 7ddee74a..a262acba 100644
--- a/src/authentic2/templates/registration/password_reset_form.html
+++ b/src/authentic2/templates/registration/password_reset_form.html
@@ -1,5 +1,5 @@
 {% extends "authentic2/base-page.html" %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block title %}
 {% trans "Resetting password" %}
@@ -11,7 +11,7 @@
 
 <form method="post">
   {% csrf_token %}
-  {{ form.as_p }}
+  {{ form|with_template }}
 
   <button class="submit-button">{% trans 'Submit' %}</button>
 </form>
diff --git a/src/authentic2/templates/registration/registration_completion_form.html b/src/authentic2/templates/registration/registration_completion_form.html
index 68c7c78b..c9b49aab 100644
--- a/src/authentic2/templates/registration/registration_completion_form.html
+++ b/src/authentic2/templates/registration/registration_completion_form.html
@@ -1,5 +1,5 @@
 {% extends "authentic2/base-page.html" %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block title %}
     {% trans "Registration" %}
@@ -10,7 +10,7 @@
       <p>{% trans "Please fill the form to complete your registration" %}</p>
       <form method="post" class="registration-completion">
         {% csrf_token %}
-        {{ form.as_p }}
+        {{ form|with_template }}
         <button class="submit-button">{% trans 'Submit' %}</button>
       </form>
 {% endblock %}
diff --git a/src/authentic2_auth_fc/templates/authentic2_auth_fc/unlink.html b/src/authentic2_auth_fc/templates/authentic2_auth_fc/unlink.html
index fc46effc..e9f2ec1b 100644
--- a/src/authentic2_auth_fc/templates/authentic2_auth_fc/unlink.html
+++ b/src/authentic2_auth_fc/templates/authentic2_auth_fc/unlink.html
@@ -1,6 +1,6 @@
 {% extends "authentic2_auth_fc/base.html"%}
 {% load staticfiles %}
-{% load i18n %}
+{% load i18n gadjo %}
 
 {% block content %}
     <p>
@@ -26,7 +26,7 @@
     {% endif %}
     <form method="post">
         {% csrf_token %}
-        {{ form.as_p }}
+        {{ form|with_template }}
         <button class="submit-button" name="unlink">{% trans "Unlink" %}</button>
         <button class="cancel-button" name="cancel" formnovalidate>{% trans "Cancel" %}</button>
     </form>
-- 
2.25.1

