From 3b743a847c0b610de348718e392d417dd008e7b5 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 7 Jun 2024 20:08:07 +0930 Subject: [PATCH] refactor: login to use base template !20 --- app/templates/base.html.j2 | 5 +++ app/templates/registration/login.html | 61 +++++++++++---------------- 2 files changed, 29 insertions(+), 37 deletions(-) diff --git a/app/templates/base.html.j2 b/app/templates/base.html.j2 index d3f4d2ef..079d0d2b 100644 --- a/app/templates/base.html.j2 +++ b/app/templates/base.html.j2 @@ -1,4 +1,5 @@ {% load settings_value %} +{% settings_value "SSO_LOGIN_ONLY_BACKEND" as SSO_LOGIN_ONLY_BACKEND %} @@ -7,8 +8,12 @@ + {% if SSO_LOGIN_ONLY_BACKEND %} + + {% else %} + {% endif %} diff --git a/app/templates/registration/login.html b/app/templates/registration/login.html index 652850d9..933c247e 100644 --- a/app/templates/registration/login.html +++ b/app/templates/registration/login.html @@ -1,43 +1,30 @@ -{% load settings_value %} -{% settings_value "SSO_LOGIN_ONLY_BACKEND" as SSO_LOGIN_ONLY_BACKEND %} - +{% extends 'base.html.j2' %} - - {% load static %} - Login - - - {% if SSO_LOGIN_ONLY_BACKEND %} - - {% else %} - - - - {% endif %} - +{% block body %} - +{% if not SSO_LOGIN_ONLY_BACKEND %} + +
- {% if not SSO_LOGIN_ONLY_BACKEND %} -
- -
-
- {% csrf_token %} -
-
- - {% for backend in social_backends %} - - {{ backend }} - - {% endfor %} -
-
+
+
+ {% csrf_token %} +
+
+ + {% for backend in social_backends %} + + {{ backend }} + + {% endfor %} +
- {% endif %} +
+{% endif %} - - - \ No newline at end of file +{% endblock %}