From 6e35513c153eeab5e2796ca15a28e47e4912dfe2 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Mon, 19 Jan 2026 23:11:02 +0530 Subject: [PATCH] Implement a custom, redesigned login page UI and add CORS support for authentication and generic API calls. --- addons/home_dashboard/controllers/__init__.py | 1 + .../__pycache__/__init__.cpython-310.pyc | Bin 178 -> 205 bytes .../__pycache__/cors.cpython-310.pyc | Bin 0 -> 1038 bytes addons/home_dashboard/controllers/cors.py | 15 +++ .../static/src/css/login_style.css | 100 +++++++++++++++--- .../home_dashboard/views/login_templates.xml | 9 +- 6 files changed, 102 insertions(+), 23 deletions(-) create mode 100644 addons/home_dashboard/controllers/__pycache__/cors.cpython-310.pyc create mode 100644 addons/home_dashboard/controllers/cors.py diff --git a/addons/home_dashboard/controllers/__init__.py b/addons/home_dashboard/controllers/__init__.py index b9e6f2b..d9cf559 100644 --- a/addons/home_dashboard/controllers/__init__.py +++ b/addons/home_dashboard/controllers/__init__.py @@ -1,2 +1,3 @@ # home_dashboard/controllers/__init__.py from . import main +from . import cors diff --git a/addons/home_dashboard/controllers/__pycache__/__init__.cpython-310.pyc b/addons/home_dashboard/controllers/__pycache__/__init__.cpython-310.pyc index f1bca3a41eeeaaae24706fa5dadf7972ff96d561..f4a3692bfab1ff1e47b9437e8ce0d11159ecc154 100644 GIT binary patch delta 113 zcmdnQc$SejpO=@50SGu9(lUc4^2++l068fPDU3M`xr|Yaj371>kj)gu1Y|P@Gib8B zWCSYFWW2?ao0ypgqLcHBiv2X1Z!r`x0cDDqfy7FNB32Nabz*`K2MdtJ!zjQA0OAo9 AD*ylh delta 86 zcmX@hxQUTBpO=@50SL0McxT#8av7r-85vTTf*CZKUorxPH5qTQ he5Sjo0 diff --git a/addons/home_dashboard/controllers/__pycache__/cors.cpython-310.pyc b/addons/home_dashboard/controllers/__pycache__/cors.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3da684943aa4737c2f6f681682640db6e48300be GIT binary patch literal 1038 zcmZWoPjAyO6t@%S&$@IBX-u0mkT@2J<$^dNG-*h1>V;b_Q5t(ox-{-=hq9`-?aFsp zkNZj%H%@#7PQ2%KQxKN?{OsTR`?D>F!vVo@c2WQI2>InUJ;4xzso#U(gwux1XhtdO zUgORD%y+uqu#9~soblj}@IcUMaO-Cw_rH=+_#1r5h+0+|Glw-&;<^*sj7tRiBZSQv zO#KOjAQ|N(^MpTToN|x*82$(2Lmu(?j^5HNaM%uDgC}g4Ck_jF2+8;C?zvR@OVRR1 zsO53G5R+63t!vq)MQ19}nz}5EuxzSjYgsE>VdDBQMzuP190bY-2ODh*vB^J`_@e!0lP#9l z?S&i#mTA#kSdUL^(8$ZWweh^rdLb3J!%3k<-biQzx_Th$0D}K{m(E&~itk1hZwt<4 ztJ6x(M9vFcO=O{XTFTZa*#IvZbfr({H}-kIk{nMX><{0;zPCr0FMDjB{%5;9aQyPZ zKt(1ki>Ar17M68ds1h&taiIQ0-U)1wycLq=A#H1V&ydCyTf+-_pySboF*O8JyR)cG zm19incQv=sHqR(j&kzr0l8eTMGhr&p;Re;Ew&B&nt!!SH$}zMNFVG{|MsN*d4h^4y zoOsKle!G1mbp!^Z$i{iz7Qkw52YC*8y9V_n&#$|p*&qsI*+9w82z3a$dW`}vsVA@w zg)}2A8h>RBj3;zI*r)Csk}=7p+=Saf)jcNnloWc|!THmTI+tE}m(BGWf7q1ykz%44 LL_!i8(?jnsyX6hv literal 0 HcmV?d00001 diff --git a/addons/home_dashboard/controllers/cors.py b/addons/home_dashboard/controllers/cors.py new file mode 100644 index 0000000..5b43d33 --- /dev/null +++ b/addons/home_dashboard/controllers/cors.py @@ -0,0 +1,15 @@ +from odoo import http +from odoo.http import request +import json + +class CorsHandler(http.Controller): + # This specifically targets the authentication endpoint for CORS + @http.route('/web/session/authenticate', type='json', auth="none", cors="*") + def authenticate_cors(self, db, login, password, base_location=None): + request.session.authenticate(db, login, password) + return request.env['ir.http'].session_info() + + # Generic search_read for the dashboard apps + @http.route('/web/dataset/call_kw', type='json', auth="user", cors="*") + def call_kw_cors(self, model, method, args, kwargs, path=None): + return request.env[model].with_user(request.uid).call_kw(method, args, kwargs) diff --git a/addons/home_dashboard/static/src/css/login_style.css b/addons/home_dashboard/static/src/css/login_style.css index 3ace60f..3114c60 100644 --- a/addons/home_dashboard/static/src/css/login_style.css +++ b/addons/home_dashboard/static/src/css/login_style.css @@ -11,7 +11,7 @@ /* Left Side: Background Image and Branding */ .o_login_left_side { - flex: 1.2 !important; + flex: 1.5 !important; display: flex !important; align-items: center !important; justify-content: center !important; @@ -43,7 +43,7 @@ /* Right Side: Form Section */ .o_login_right_side { - flex: 1.2 !important; + flex: 1 !important; /* background: #ffffff !important; */ display: flex !important; justify-content: center !important; @@ -56,15 +56,17 @@ width: 60% } -/* Floating Card UI */ +/* Glassmorphism Card UI */ .o_login_card { width: 100% !important; - max-width: 600px !important; + max-width: 450px !important; padding: 40px !important; - background: #ffffff !important; - border-radius: 25px !important; - box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important; - border: 1px solid #f1f1f1 !important; + background: rgba(255, 255, 255, 0.05) !important; + backdrop-filter: blur(15px) !important; + -webkit-backdrop-filter: blur(15px) !important; + border-radius: 20px !important; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important; + border: 1px solid rgba(255, 255, 255, 0.1) !important; z-index: 2; } @@ -74,6 +76,7 @@ font-weight: 800 !important; margin-bottom: 10px; background: -webkit-linear-gradient(#2bb1a5, #fecd4f); + background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } @@ -85,22 +88,36 @@ } .o_login_logo_container img { - max-height: 80px; + max-height: 120px; + /* Larger logo */ width: auto; + filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2)); } /* Form Inputs */ +.form-control:focus { + border-color: #2bb1a5 !important; + box-shadow: 0 0 0 3px rgba(43, 177, 165, 0.2) !important; + background: rgba(255, 255, 255, 0.1) !important; +} + +.o_login_form_container label { + color: rgba(255, 255, 255, 0.8) !important; + margin-bottom: 8px; + font-weight: 500; +} + .form-control { - background: #f9f9f9 !important; - border: 1px solid #edeef0 !important; + background: rgba(255, 255, 255, 0.05) !important; + border: 1px solid rgba(255, 255, 255, 0.1) !important; border-radius: 12px !important; padding: 12px 15px !important; height: auto !important; + color: white !important; } -.form-control:focus { - border-color: #2bb1a5 !important; - box-shadow: 0 0 0 3px rgba(43, 177, 165, 0.1) !important; +.form-control::placeholder { + color: rgba(255, 255, 255, 0.3) !important; } /* Login Button with Gradient */ @@ -134,16 +151,32 @@ } .o_login_right_side { - background: linear-gradient(135deg, #fecd4f 0%, #2bb1a5 100%) !important; + background: #0f172a !important; + /* Keep dark background on mobile */ } } -/* Hide Website Header/Footer to ensure standard "Backend-Style" Login UI */ +/* Hide Website Header/Footer ONLY on Login, Signup, Reset Password */ body.o_custom_login_body header, body.o_custom_login_body footer, body.o_custom_login_body .o_footer_copyright, -body.o_custom_login_body #o_main_nav { +body.o_custom_login_body #o_main_nav, +body.o_custom_login_body .o_header_standard, +body.o_custom_login_body #wrapwrap>header, +body.o_custom_login_body #wrapwrap>footer { display: none !important; + height: 0 !important; + width: 0 !important; + visibility: hidden !important; + opacity: 0 !important; + position: absolute !important; + pointer-events: none !important; +} + +/* Ensure wrapwrap doesn't have padding/margin from header on these pages */ +body.o_custom_login_body #wrapwrap { + padding-top: 0 !important; + margin-top: 0 !important; } /* Ensure the wrapper covers the entire screen, ignoring website container constraints */ @@ -190,4 +223,37 @@ body.o_custom_login_body .o_login_main_wrapper { .o_login_footer_custom a:hover { color: #fecd4f; +} + + + + + +/* website login screen */ +.oe_website_login_container { + display: flex !important; + justify-content: center !important; + align-items: center !important; + height: 100vh !important; + /* width: 100vw !important; */ + overflow: hidden !important; + background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), + url('/home_dashboard/static/src/img/login_bg.png') no-repeat center center !important; + background-size: cover !important; + color: white !important; +} + +.oe_website_login_container .oe_login_form, +.oe_website_login_container .oe_signup_form, +.oe_website_login_container .oe_reset_password_form { + width: 60% !important; + padding: 40px !important; + background: rgba(255, 255, 255, 0.05) !important; + backdrop-filter: blur(15px) !important; + -webkit-backdrop-filter: blur(15px) !important; + border-radius: 20px !important; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important; + border: 1px solid rgba(255, 255, 255, 0.1) !important; + z-index: 2; + max-width: 400px; } \ No newline at end of file diff --git a/addons/home_dashboard/views/login_templates.xml b/addons/home_dashboard/views/login_templates.xml index d7e7e78..2e7e117 100644 --- a/addons/home_dashboard/views/login_templates.xml +++ b/addons/home_dashboard/views/login_templates.xml @@ -12,10 +12,7 @@