From b6326f399c2e4f35dd0f2430cd46ff4c1c38c0cc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 21 Feb 2020 15:00:45 +0100 Subject: [PATCH] ui: clean up more generic forms, remove is_login everywhere --- .../admin/templates/administration/base.html | 6 - passbook/admin/templates/generic/form.html | 74 ++++--- passbook/admin/templates/generic/list.html | 29 --- passbook/core/templates/error/400.html | 7 +- passbook/core/templates/generic/delete.html | 52 +++-- passbook/core/templates/login/base.html | 11 +- passbook/core/templates/login/denied.html | 2 +- passbook/core/templates/login/form.html | 18 +- passbook/core/templates/partials/form.html | 82 +++---- .../templates/partials/form_horizontal.html | 59 +++++ .../templates/partials/form_login_pf4.html | 52 ----- .../core/templates/partials/messages.html | 22 +- passbook/core/views/authentication.py | 2 - passbook/core/views/error.py | 8 - passbook/core/views/user.py | 1 - passbook/core/views/utils.py | 2 - passbook/factors/base.py | 1 - passbook/factors/otp/views.py | 1 - passbook/providers/oauth/views/oauth2.py | 5 - passbook/providers/saml/views.py | 19 +- passbook/root/settings.py | 2 +- passbook/static/static/passbook/pf.css | 207 ++++++++++++++++++ 22 files changed, 423 insertions(+), 239 deletions(-) delete mode 100644 passbook/admin/templates/generic/list.html create mode 100644 passbook/core/templates/partials/form_horizontal.html delete mode 100644 passbook/core/templates/partials/form_login_pf4.html diff --git a/passbook/admin/templates/administration/base.html b/passbook/admin/templates/administration/base.html index 1fb106800..e4892177f 100644 --- a/passbook/admin/templates/administration/base.html +++ b/passbook/admin/templates/administration/base.html @@ -1,7 +1 @@ {% extends "overview/base.html" %} - -{% load i18n %} -{% load is_active %} - -{% block nav_secondary %} -{% endblock %} diff --git a/passbook/admin/templates/generic/form.html b/passbook/admin/templates/generic/form.html index b25fe016b..006e932f1 100644 --- a/passbook/admin/templates/generic/form.html +++ b/passbook/admin/templates/generic/form.html @@ -24,41 +24,57 @@ {% endblock %} {% block content %} -
- {% block above_form %} - {% endblock %} -
-
- {% include 'partials/form.html' with form=form %} - {% block beneath_form %} - {% endblock %} - {% trans "Cancel" %} - -
-
- -
+ {% endblock %} {% block scripts %} diff --git a/passbook/admin/templates/generic/list.html b/passbook/admin/templates/generic/list.html deleted file mode 100644 index a3ee7ac83..000000000 --- a/passbook/admin/templates/generic/list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "administration/base.html" %} - -{% load i18n %} -{% load utils %} - -{% block content %} -
- {% block above_table %} - {% endblock %} - - - - - - - - - - {% for source in object_list %} - - - - - - {% endfor %} - -
{% trans 'Name' %}{% trans 'Class' %}
{{ source.name }}{{ source.cast|fieldtype }}{% trans 'Edit' %}
-
-{% endblock %} \ No newline at end of file diff --git a/passbook/core/templates/error/400.html b/passbook/core/templates/error/400.html index 410263962..4c6d5c069 100644 --- a/passbook/core/templates/error/400.html +++ b/passbook/core/templates/error/400.html @@ -14,10 +14,11 @@ {% endblock %} +{% block card_title %} +{% trans 'Bad Request' %} +{% endblock %} + {% block card %} -
-

{% trans 'Bad Request' %}

-
{% if message %}

{% trans message %}

diff --git a/passbook/core/templates/generic/delete.html b/passbook/core/templates/generic/delete.html index 41cb1bd2d..592f11f90 100644 --- a/passbook/core/templates/generic/delete.html +++ b/passbook/core/templates/generic/delete.html @@ -4,22 +4,40 @@ {% load utils %} {% block content %} -
- {% block above_form %} -

{% blocktrans with object_type=object|verbose_name %}Delete {{ object_type }}{% endblocktrans %}

- {% endblock %} -
- - {% csrf_token %} -

- {% blocktrans with object_type=object|verbose_name name=object %} - Are you sure you want to delete {{ object_type }} "{{ object }}"? - {% endblocktrans %} -

- - {% trans 'Back' %} - - +
+
+ {% block above_form %} +

+ {% blocktrans with object_type=object|verbose_name %} + Delete {{ object_type }} + {% endblocktrans %} +

+ {% endblock %}
-
+ +
+
+
+
+
+
+ {% csrf_token %} +

+ {% blocktrans with object_type=object|verbose_name name=object %} + Are you sure you want to delete {{ object_type }} "{{ object }}"? + {% endblocktrans %} +

+ +
+ +
+
+
+
+
+
+
{% endblock %} diff --git a/passbook/core/templates/login/base.html b/passbook/core/templates/login/base.html index 6c59152f7..45339ae5a 100644 --- a/passbook/core/templates/login/base.html +++ b/passbook/core/templates/login/base.html @@ -17,6 +17,7 @@
+{% include 'partials/messages.html' %}