From a5319fc2fe264cf98655e459e732f01d1b4b3df8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 15 May 2020 10:54:31 +0200 Subject: [PATCH] *: rename templatetags to clearly identify --- passbook/admin/templates/administration/application/list.html | 2 +- passbook/admin/templates/administration/audit/list.html | 2 +- passbook/admin/templates/administration/base.html | 4 ++-- .../templates/administration/certificatekeypair/list.html | 2 +- passbook/admin/templates/administration/debug/request.html | 2 +- passbook/admin/templates/administration/flow/list.html | 2 +- passbook/admin/templates/administration/group/list.html | 2 +- passbook/admin/templates/administration/invitation/list.html | 2 +- passbook/admin/templates/administration/policy/list.html | 2 +- .../admin/templates/administration/property_mapping/list.html | 2 +- passbook/admin/templates/administration/provider/list.html | 2 +- passbook/admin/templates/administration/source/list.html | 2 +- passbook/admin/templates/administration/stage/list.html | 2 +- passbook/admin/templates/administration/user/list.html | 2 +- passbook/admin/templates/generic/create.html | 2 +- passbook/admin/templates/generic/form.html | 2 +- passbook/admin/templates/generic/update.html | 2 +- passbook/core/templates/403_csrf.html | 2 +- passbook/core/templates/base/page.html | 4 ++-- passbook/core/templates/base/skeleton.html | 2 +- passbook/core/templates/error/generic.html | 2 +- passbook/core/templates/generic/delete.html | 2 +- passbook/core/templates/login/denied.html | 2 +- passbook/core/templates/login/form_with_user.html | 2 +- passbook/core/templates/login/loading.html | 2 +- passbook/core/templates/overview/base.html | 4 ++-- passbook/core/templates/partials/form.html | 2 +- passbook/core/templates/partials/form_horizontal.html | 2 +- passbook/core/templates/user/base.html | 2 +- passbook/flows/views.py | 1 - passbook/lib/templates/lib/arrayfield.html | 2 +- .../lib/templatetags/{is_active.py => passbook_is_active.py} | 4 ---- passbook/lib/templatetags/{utils.py => passbook_utils.py} | 0 .../providers/oauth/templates/oauth2_provider/authorize.html | 2 +- .../providers/oidc/templates/oidc_provider/authorize.html | 2 +- passbook/providers/oidc/templates/oidc_provider/error.html | 2 +- .../providers/saml/templates/saml/idp/autosubmit_form.html | 2 +- passbook/providers/saml/templates/saml/idp/login.html | 2 +- passbook/sources/saml/templates/saml/sp/login.html | 2 +- .../stages/email/templates/stages/email/for_email/base.html | 2 +- .../templates/stages/email/for_email/password_reset.html | 2 +- .../templates/stages/identification/recovery.html | 1 - passbook/stages/otp/templates/stages/otp/user_settings.html | 2 +- 43 files changed, 42 insertions(+), 48 deletions(-) rename passbook/lib/templatetags/{is_active.py => passbook_is_active.py} (93%) rename passbook/lib/templatetags/{utils.py => passbook_utils.py} (100%) diff --git a/passbook/admin/templates/administration/application/list.html b/passbook/admin/templates/administration/application/list.html index 533f94e03..bb1576e7c 100644 --- a/passbook/admin/templates/administration/application/list.html +++ b/passbook/admin/templates/administration/application/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/audit/list.html b/passbook/admin/templates/administration/audit/list.html index 43844f362..ed793e650 100644 --- a/passbook/admin/templates/administration/audit/list.html +++ b/passbook/admin/templates/administration/audit/list.html @@ -1,7 +1,7 @@ {% extends "base/page.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block page_content %}
diff --git a/passbook/admin/templates/administration/base.html b/passbook/admin/templates/administration/base.html index 9bde9d06f..bad5812f3 100644 --- a/passbook/admin/templates/administration/base.html +++ b/passbook/admin/templates/administration/base.html @@ -3,8 +3,8 @@ {% load static %} {% load i18n %} -{% load is_active %} -{% load utils %} +{% load passbook_is_active %} +{% load passbook_utils %} {% block head %} {{ block.super }} diff --git a/passbook/admin/templates/administration/certificatekeypair/list.html b/passbook/admin/templates/administration/certificatekeypair/list.html index bfc62f86e..51e87b6cc 100644 --- a/passbook/admin/templates/administration/certificatekeypair/list.html +++ b/passbook/admin/templates/administration/certificatekeypair/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/debug/request.html b/passbook/admin/templates/administration/debug/request.html index f4baeea58..999890476 100644 --- a/passbook/admin/templates/administration/debug/request.html +++ b/passbook/admin/templates/administration/debug/request.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/flow/list.html b/passbook/admin/templates/administration/flow/list.html index 8d1691686..da02a560c 100644 --- a/passbook/admin/templates/administration/flow/list.html +++ b/passbook/admin/templates/administration/flow/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/group/list.html b/passbook/admin/templates/administration/group/list.html index 5695f3b7e..096e4adef 100644 --- a/passbook/admin/templates/administration/group/list.html +++ b/passbook/admin/templates/administration/group/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/invitation/list.html b/passbook/admin/templates/administration/invitation/list.html index 944d8a261..a60bb8995 100644 --- a/passbook/admin/templates/administration/invitation/list.html +++ b/passbook/admin/templates/administration/invitation/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/policy/list.html b/passbook/admin/templates/administration/policy/list.html index 28f238854..051ad5140 100644 --- a/passbook/admin/templates/administration/policy/list.html +++ b/passbook/admin/templates/administration/policy/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/property_mapping/list.html b/passbook/admin/templates/administration/property_mapping/list.html index 29d9d30ad..7970e91c7 100644 --- a/passbook/admin/templates/administration/property_mapping/list.html +++ b/passbook/admin/templates/administration/property_mapping/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/administration/provider/list.html b/passbook/admin/templates/administration/provider/list.html index 4477078f2..513401496 100644 --- a/passbook/admin/templates/administration/provider/list.html +++ b/passbook/admin/templates/administration/provider/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% load admin_reflection %} {% block content %} diff --git a/passbook/admin/templates/administration/source/list.html b/passbook/admin/templates/administration/source/list.html index d8b651b86..caa1e36a1 100644 --- a/passbook/admin/templates/administration/source/list.html +++ b/passbook/admin/templates/administration/source/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% load admin_reflection %} {% block content %} diff --git a/passbook/admin/templates/administration/stage/list.html b/passbook/admin/templates/administration/stage/list.html index 0c8894165..8318bdf18 100644 --- a/passbook/admin/templates/administration/stage/list.html +++ b/passbook/admin/templates/administration/stage/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% load admin_reflection %} {% block content %} diff --git a/passbook/admin/templates/administration/user/list.html b/passbook/admin/templates/administration/user/list.html index 95a6cd4ce..54568d2a1 100644 --- a/passbook/admin/templates/administration/user/list.html +++ b/passbook/admin/templates/administration/user/list.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/admin/templates/generic/create.html b/passbook/admin/templates/generic/create.html index c62000bf1..1358e6ba2 100644 --- a/passbook/admin/templates/generic/create.html +++ b/passbook/admin/templates/generic/create.html @@ -1,6 +1,6 @@ {% extends base_template|default:"generic/form.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block above_form %} diff --git a/passbook/admin/templates/generic/form.html b/passbook/admin/templates/generic/form.html index e42819d94..791f2e9e6 100644 --- a/passbook/admin/templates/generic/form.html +++ b/passbook/admin/templates/generic/form.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% load static %} {% block head %} diff --git a/passbook/admin/templates/generic/update.html b/passbook/admin/templates/generic/update.html index 738a45e25..d52bb8fb4 100644 --- a/passbook/admin/templates/generic/update.html +++ b/passbook/admin/templates/generic/update.html @@ -1,6 +1,6 @@ {% extends base_template|default:"generic/form.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block above_form %} diff --git a/passbook/core/templates/403_csrf.html b/passbook/core/templates/403_csrf.html index c1ec9425e..9fd0de3a9 100644 --- a/passbook/core/templates/403_csrf.html +++ b/passbook/core/templates/403_csrf.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block card_title %} {{ title }} (403) diff --git a/passbook/core/templates/base/page.html b/passbook/core/templates/base/page.html index 27a793e28..4ffa46c20 100644 --- a/passbook/core/templates/base/page.html +++ b/passbook/core/templates/base/page.html @@ -3,8 +3,8 @@ {% load static %} {% load i18n %} -{% load is_active %} -{% load utils %} +{% load passbook_is_active %} +{% load passbook_utils %} {% block body %} {% include 'partials/messages.html' %} diff --git a/passbook/core/templates/base/skeleton.html b/passbook/core/templates/base/skeleton.html index ddd607855..bcae7ff0d 100644 --- a/passbook/core/templates/base/skeleton.html +++ b/passbook/core/templates/base/skeleton.html @@ -1,6 +1,6 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} diff --git a/passbook/core/templates/error/generic.html b/passbook/core/templates/error/generic.html index 1c5b2ea5a..24595d1c8 100644 --- a/passbook/core/templates/error/generic.html +++ b/passbook/core/templates/error/generic.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block card_title %} {% trans 'Bad Request' %} diff --git a/passbook/core/templates/generic/delete.html b/passbook/core/templates/generic/delete.html index 592f11f90..92e5bd6dc 100644 --- a/passbook/core/templates/generic/delete.html +++ b/passbook/core/templates/generic/delete.html @@ -1,7 +1,7 @@ {% extends "administration/base.html" %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block content %}
diff --git a/passbook/core/templates/login/denied.html b/passbook/core/templates/login/denied.html index aff267096..35e9d6916 100644 --- a/passbook/core/templates/login/denied.html +++ b/passbook/core/templates/login/denied.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block card %}
diff --git a/passbook/core/templates/login/form_with_user.html b/passbook/core/templates/login/form_with_user.html index f1b418b65..6eb1412f5 100644 --- a/passbook/core/templates/login/form_with_user.html +++ b/passbook/core/templates/login/form_with_user.html @@ -1,7 +1,7 @@ {% extends 'login/form.html' %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block head %} {{ block.super }} diff --git a/passbook/core/templates/login/loading.html b/passbook/core/templates/login/loading.html index 239370e51..be3026958 100644 --- a/passbook/core/templates/login/loading.html +++ b/passbook/core/templates/login/loading.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block title %} {% trans title %} diff --git a/passbook/core/templates/overview/base.html b/passbook/core/templates/overview/base.html index 205ee5a56..53a40f611 100644 --- a/passbook/core/templates/overview/base.html +++ b/passbook/core/templates/overview/base.html @@ -3,8 +3,8 @@ {% load static %} {% load i18n %} -{% load is_active %} -{% load utils %} +{% load passbook_is_active %} +{% load passbook_utils %} {% block page_content %}
diff --git a/passbook/core/templates/partials/form.html b/passbook/core/templates/partials/form.html index 77c867889..83a6e8ae3 100644 --- a/passbook/core/templates/partials/form.html +++ b/passbook/core/templates/partials/form.html @@ -1,4 +1,4 @@ -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% csrf_token %} diff --git a/passbook/core/templates/partials/form_horizontal.html b/passbook/core/templates/partials/form_horizontal.html index 481705d6e..facce648e 100644 --- a/passbook/core/templates/partials/form_horizontal.html +++ b/passbook/core/templates/partials/form_horizontal.html @@ -1,4 +1,4 @@ -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% csrf_token %} diff --git a/passbook/core/templates/user/base.html b/passbook/core/templates/user/base.html index 36770773b..4c0c6798b 100644 --- a/passbook/core/templates/user/base.html +++ b/passbook/core/templates/user/base.html @@ -1,7 +1,7 @@ {% extends "base/page.html" %} {% load i18n %} -{% load is_active %} +{% load passbook_is_active %} {% load static %} {% load passbook_user_settings %} diff --git a/passbook/flows/views.py b/passbook/flows/views.py index 43ca4e609..c1c01de66 100644 --- a/passbook/flows/views.py +++ b/passbook/flows/views.py @@ -192,7 +192,6 @@ class ToDefaultFlow(View): flow_slug=flow.slug, ) del self.request.session[SESSION_KEY_PLAN] - # TODO: Get Flow depending on subdomain? return redirect_with_qs( "passbook_flows:flow-executor", request.GET, flow_slug=flow.slug ) diff --git a/passbook/lib/templates/lib/arrayfield.html b/passbook/lib/templates/lib/arrayfield.html index 85705402c..3966470de 100644 --- a/passbook/lib/templates/lib/arrayfield.html +++ b/passbook/lib/templates/lib/arrayfield.html @@ -1,4 +1,4 @@ -{% load utils %} +{% load passbook_utils %} {% spaceless %}
diff --git a/passbook/lib/templatetags/is_active.py b/passbook/lib/templatetags/passbook_is_active.py similarity index 93% rename from passbook/lib/templatetags/is_active.py rename to passbook/lib/templatetags/passbook_is_active.py index 8a9815394..47acabc8d 100644 --- a/passbook/lib/templatetags/is_active.py +++ b/passbook/lib/templatetags/passbook_is_active.py @@ -33,8 +33,6 @@ def is_active(context, *args, **kwargs): @register.simple_tag(takes_context=True) def is_active_url(context, view): """Return whether a navbar link is active or not.""" - - # matching_url = reverse(view, args=args, kwargs=kwargs) request = context.get("request") current_full_url = ( f"{request.resolver_match.app_name}:{request.resolver_match.url_name}" @@ -44,8 +42,6 @@ def is_active_url(context, view): return "" if current_full_url == view: return ACTIVE_STRING - # if matching_url == request.path: - # return 'active' return "" diff --git a/passbook/lib/templatetags/utils.py b/passbook/lib/templatetags/passbook_utils.py similarity index 100% rename from passbook/lib/templatetags/utils.py rename to passbook/lib/templatetags/passbook_utils.py diff --git a/passbook/providers/oauth/templates/oauth2_provider/authorize.html b/passbook/providers/oauth/templates/oauth2_provider/authorize.html index b80a05ea8..24635ad37 100644 --- a/passbook/providers/oauth/templates/oauth2_provider/authorize.html +++ b/passbook/providers/oauth/templates/oauth2_provider/authorize.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block card_title %} diff --git a/passbook/providers/oidc/templates/oidc_provider/authorize.html b/passbook/providers/oidc/templates/oidc_provider/authorize.html index 5a1fa1780..9326ee625 100644 --- a/passbook/providers/oidc/templates/oidc_provider/authorize.html +++ b/passbook/providers/oidc/templates/oidc_provider/authorize.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block card_title %} diff --git a/passbook/providers/oidc/templates/oidc_provider/error.html b/passbook/providers/oidc/templates/oidc_provider/error.html index a4250fdd8..24e4116e0 100644 --- a/passbook/providers/oidc/templates/oidc_provider/error.html +++ b/passbook/providers/oidc/templates/oidc_provider/error.html @@ -2,7 +2,7 @@ {% load static %} {% load i18n %} -{% load utils %} +{% load passbook_utils %} {% block card_title %} {% trans error %} diff --git a/passbook/providers/saml/templates/saml/idp/autosubmit_form.html b/passbook/providers/saml/templates/saml/idp/autosubmit_form.html index b43f243db..dff5c2dba 100644 --- a/passbook/providers/saml/templates/saml/idp/autosubmit_form.html +++ b/passbook/providers/saml/templates/saml/idp/autosubmit_form.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block card_title %} diff --git a/passbook/providers/saml/templates/saml/idp/login.html b/passbook/providers/saml/templates/saml/idp/login.html index d4257cab7..241b40e20 100644 --- a/passbook/providers/saml/templates/saml/idp/login.html +++ b/passbook/providers/saml/templates/saml/idp/login.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block card %} diff --git a/passbook/sources/saml/templates/saml/sp/login.html b/passbook/sources/saml/templates/saml/sp/login.html index 825bbfe4a..4a47376ac 100644 --- a/passbook/sources/saml/templates/saml/sp/login.html +++ b/passbook/sources/saml/templates/saml/sp/login.html @@ -1,6 +1,6 @@ {% extends "login/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% block title %} diff --git a/passbook/stages/email/templates/stages/email/for_email/base.html b/passbook/stages/email/templates/stages/email/for_email/base.html index 21f4f9db1..996f22e58 100644 --- a/passbook/stages/email/templates/stages/email/for_email/base.html +++ b/passbook/stages/email/templates/stages/email/for_email/base.html @@ -1,5 +1,5 @@ {% load passbook_stages_email %} -{% load utils %} +{% load passbook_utils %} {% load static %} {% load i18n %} diff --git a/passbook/stages/email/templates/stages/email/for_email/password_reset.html b/passbook/stages/email/templates/stages/email/for_email/password_reset.html index deb24fb61..6632a36fd 100644 --- a/passbook/stages/email/templates/stages/email/for_email/password_reset.html +++ b/passbook/stages/email/templates/stages/email/for_email/password_reset.html @@ -1,6 +1,6 @@ {% extends "stages/email/for_email/base.html" %} -{% load utils %} +{% load passbook_utils %} {% load i18n %} {% load humanize %} diff --git a/passbook/stages/identification/templates/stages/identification/recovery.html b/passbook/stages/identification/templates/stages/identification/recovery.html index 1cf4c4838..4a425ff9c 100644 --- a/passbook/stages/identification/templates/stages/identification/recovery.html +++ b/passbook/stages/identification/templates/stages/identification/recovery.html @@ -55,7 +55,6 @@