From 2e8c2a4d0ed0686f93492d0a39e69e0ce6b44884 Mon Sep 17 00:00:00 2001 From: farhan Date: Sun, 6 Apr 2025 11:49:24 -0500 Subject: [PATCH 1/3] Refactor authentication pages: replaced Bootstrap with Tailwind CSS --- templates/account/login.html | 132 +++++++++++++++--------- templates/account/signup.html | 113 ++++++++++++++------- templates/portal/base.html | 185 ++++++++++++++++++++++++++-------- templates/portal/index.html | 87 +++++++++------- 4 files changed, 358 insertions(+), 159 deletions(-) diff --git a/templates/account/login.html b/templates/account/login.html index 616898b9..b4e63b8a 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -1,58 +1,100 @@ {% extends "account/base_entrance.html" %} {% load i18n %} {% load allauth account %} + {% block head_title %} {% trans "Sign In" %} {% endblock head_title %} + {% block content %} - {% element h1 %} - {% trans "Sign In" %} - {% endelement %} - {% if not SOCIALACCOUNT_ONLY %} - {% setvar link %} - - {% endsetvar %} - {% setvar end_link %} - - {% endsetvar %} - {% element p %} - {% blocktranslate %}If you have not created an account yet, then please {{ link }}sign up{{ end_link }} first.{% endblocktranslate %} - {% endelement %} - {% url 'account_login' as login_url %} - {% element form form=form method="post" action=login_url tags="entrance,login" %} - {% slot body %} +
+
+

{% trans "Sign In" %}

+ + {% if not SOCIALACCOUNT_ONLY %} +

+ {% blocktranslate %}If you have not created an account yet, then please sign up first.{% endblocktranslate %} +

+ + {% url 'account_login' as login_url %} +
{% csrf_token %} - {% element fields form=form unlabeled=True %} - {% endelement %} + +
+ {% for field in form %} +
+ + + {% if field.help_text %} +

{{ field.help_text }}

+ {% endif %} + {% if field.errors %} +
+ {{ field.errors }} +
+ {% endif %} +
+ {% endfor %} +
+ {{ redirect_field }} - {% endslot %} - {% slot actions %} - {% element button type="submit" tags="prominent,login" %} + + +
+ {% endif %} + + {% if LOGIN_BY_CODE_ENABLED or PASSKEY_LOGIN_ENABLED %} +
+ {% if PASSKEY_LOGIN_ENABLED %} + + {% endif %} + {% if LOGIN_BY_CODE_ENABLED %} + + {% trans "Send me a sign-in code" %} + + {% endif %} +
+ {% endif %} + + {% if SOCIALACCOUNT_ENABLED %} + {% include "socialaccount/snippets/login.html" with page_layout="entrance" %} + {% endif %} +
+
+ + +{% endblock %} + {% block extra_body %} {{ block.super }} {% if PASSKEY_LOGIN_ENABLED %} diff --git a/templates/account/signup.html b/templates/account/signup.html index 845b91f4..de9c76cb 100644 --- a/templates/account/signup.html +++ b/templates/account/signup.html @@ -1,46 +1,89 @@ {% extends "account/base_entrance.html" %} {% load allauth i18n %} {% load django_bootstrap5 %} + {% block head_title %} {% trans "Signup" %} {% endblock head_title %} + {% block content %} - {% element h1 %} - {% trans "Sign Up" %} - {% endelement %} - {% setvar link %} - - {% endsetvar %} - {% setvar end_link %} - - {% endsetvar %} - {% element p %} - {% blocktranslate %}Already have an account? Then please {{ link }}sign in{{ end_link }}.{% endblocktranslate %} - {% endelement %} - {% if not SOCIALACCOUNT_ONLY %} - {% url 'account_signup' as action_url %} - {% element form form=form method="post" action=action_url tags="entrance,signup" %} - {% slot body %} +
+
+

{% trans "Sign Up" %}

+ +

+ {% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %} +

+ + {% if not SOCIALACCOUNT_ONLY %} + {% url 'account_signup' as action_url %} +
{% csrf_token %} - {% element fields form=form unlabeled=True %} - {% endelement %} + +
+ {% for field in form %} +
+ + + {% if field.help_text %} +

{{ field.help_text }}

+ {% endif %} + {% if field.errors %} +
+ {{ field.errors }} +
+ {% endif %} +
+ {% endfor %} +
+ {{ redirect_field }} - {% endslot %} - {% slot actions %} - {% element button tags="prominent,signup" type="submit" %} + + +
+ {% endif %} + + {% if PASSKEY_SIGNUP_ENABLED %} + + {% endif %} + + {% if SOCIALACCOUNT_ENABLED %} + {% include "socialaccount/snippets/login.html" with page_layout="entrance" %} + {% endif %} +
+
+ + {% endblock content %} diff --git a/templates/portal/base.html b/templates/portal/base.html index bcc97f3c..a4f483a7 100644 --- a/templates/portal/base.html +++ b/templates/portal/base.html @@ -1,5 +1,4 @@ {% load i18n %} -{% load django_bootstrap5 %} @@ -10,87 +9,193 @@ {% block head_title %} {% endblock head_title %} + + + + + + + + + + + + + + + + + + + {% block extra_head %} {% endblock extra_head %} - {% bootstrap_css %} - {% bootstrap_javascript %} - {# Display django.contrib.messages as Bootstrap alerts #} - {% bootstrap_messages %} + + + - + {% block body %} {% endblock %} -