From 2ac9656203e2f33c6661ec95f0cddb17e62d3133 Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Fri, 23 Oct 2026 23:21:58 -0400 Subject: [PATCH] Fix mobile UI for faculty/admin backend dashboard The faculty/admin backend (sidebar, top nav, dashboard widgets) had zero mobile responsiveness, unlike the login page and student portal which already had proper breakpoints. On a phone the fixed 260px sidebar plus its unconditional margin-left permanently ate most of the screen, and the dashboard's KPI/chart/widget rows used fixed CSS grid columns with no stacking. - sidebar.xml: sidebar goes off-canvas below 768px with a hamburger toggle and tap-to-close backdrop, instead of always being visible - backend_forms.scss: content margin-left and the forced display:flex/overflow:visible on the top menu are now scoped to desktop only, restoring Odoo's native d-none d-md-flex mobile hide that the override was defeating - education_dashboard_templates.xml: KPI/chart/widget grids stack to 2-col/1-col under 768px/420px instead of staying fixed at 5/3 cols Co-Authored-By: Claude Sonnet 5 --- .../src/xml/education_dashboard_templates.xml | 28 ++++++++++++++---- .../static/src/scss/backend_forms.scss | 29 +++++++++++++------ .../static/src/xml/sidebar.xml | 27 +++++++++++++++++ 3 files changed, 70 insertions(+), 14 deletions(-) diff --git a/addons/education_dashboard/static/src/xml/education_dashboard_templates.xml b/addons/education_dashboard/static/src/xml/education_dashboard_templates.xml index 8d2cd63..47c594b 100644 --- a/addons/education_dashboard/static/src/xml/education_dashboard_templates.xml +++ b/addons/education_dashboard/static/src/xml/education_dashboard_templates.xml @@ -1,7 +1,7 @@ -
+
-
+
@@ -39,7 +57,7 @@
-
+
@@ -78,7 +96,7 @@
-
+
@@ -156,7 +174,7 @@
-
+
diff --git a/addons/theme_student_erp_custom/static/src/scss/backend_forms.scss b/addons/theme_student_erp_custom/static/src/scss/backend_forms.scss index 74dc62c..9dc73de 100644 --- a/addons/theme_student_erp_custom/static/src/scss/backend_forms.scss +++ b/addons/theme_student_erp_custom/static/src/scss/backend_forms.scss @@ -28,9 +28,13 @@ body.o_web_client { height: 100% !important; // fill the available viewport height } -// Only push content when our custom sidebar is present -body.o_web_client:has(.o_sidebar_custom) .o_action_manager { - margin-left: 260px; +// Only push content when our custom sidebar is present (desktop only — +// below 768px the sidebar goes off-canvas, see sidebar.xml, so content +// must stay full-width instead of leaving a permanent 260px gap) +@media (min-width: 769px) { + body.o_web_client:has(.o_sidebar_custom) .o_action_manager { + margin-left: 260px; + } } // Inner content containers — let them grow freely @@ -60,12 +64,19 @@ body.o_web_client:has(.o_sidebar_custom) .o_action_manager { background-color: transparent !important; } - // Ensure horizontal menus are always visible in the header - .o_menu_sections { - display: flex !important; - flex-grow: 1 !important; - align-items: center !important; - overflow: visible !important; + // Ensure horizontal menus are always visible in the header — desktop only. + // Odoo's own navbar.xml marks .o_menu_sections/.o_menu_brand "d-none d-md-flex" + // (hidden under 768px) and relies on that for mobile; forcing display:flex + // unconditionally here defeated that native hide and the overflow "more" + // dropdown. Below 768px the custom sidebar (see sidebar.xml) is the nav + // instead, so let the top menu fall back to Odoo's native hidden state. + @media (min-width: 769px) { + .o_menu_sections { + display: flex !important; + flex-grow: 1 !important; + align-items: center !important; + overflow: visible !important; + } } // Explicitly override Odoo's internal enterprise variables diff --git a/addons/theme_student_erp_custom/static/src/xml/sidebar.xml b/addons/theme_student_erp_custom/static/src/xml/sidebar.xml index 2f6720d..fbe26f0 100644 --- a/addons/theme_student_erp_custom/static/src/xml/sidebar.xml +++ b/addons/theme_student_erp_custom/static/src/xml/sidebar.xml @@ -5,10 +5,37 @@ + + + + + +