Remove duplicate mobile hamburger from faculty/admin sidebar

Restoring Odoo's native d-none d-md-flex hide on .o_menu_sections
(previous commit) revealed its own built-in "All Apps" mobile burger
menu, which already lists the full Education app sections (Dashboard,
Master Data, Students, ...) in its native drawer. The custom
off-canvas sidebar + hamburger toggle added in the previous commit
duplicated that, showing two hamburgers in the mobile header. Drop
the custom toggle/backdrop and just hide the custom sidebar below
768px, deferring entirely to Odoo's native mobile menu.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
metatroncubeswdev 2026-10-23 23:35:38 -04:00
parent 2ac9656203
commit 0afe2adfd2

View File

@ -5,36 +5,17 @@
<xpath expr="//nav" position="inside">
<t t-if="currentApp and currentApp.name === 'Education'">
<!-- Mobile hamburger toggle: hidden by default, shown only below 768px (Odoo's own "md" breakpoint) -->
<!-- Centered: Odoo's own app-switcher icon (left) and systray (right)
stay visible on mobile natively, so the center is the open slot
once the brand name / section menu hide below 768px. -->
<div id="eduSidebarToggle"
onclick="document.querySelector('.o_sidebar_custom').classList.add('o_sidebar_open'); document.querySelector('.o_sidebar_backdrop').classList.add('o_sidebar_open');"
style="display:none; position:fixed; top:14px; left:50%; transform:translateX(-50%); z-index:111; width:42px; height:42px; border-radius:10px; background:rgba(0,0,0,0.25); color:#fff; align-items:center; justify-content:center; cursor:pointer;">
<i class="fa fa-bars" style="font-size:1.1rem;"/>
</div>
<!-- Backdrop: closes sidebar on outside tap, mobile only -->
<div class="o_sidebar_backdrop"
onclick="document.querySelector('.o_sidebar_custom').classList.remove('o_sidebar_open'); this.classList.remove('o_sidebar_open');"
style="display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:89;"/>
<div class="o_sidebar_custom d-flex flex-column position-fixed"
style="top: 70px; bottom: 0; left: 0; width: 260px; background: linear-gradient(135deg, #1f8f8f 0%, #144d4d 55%, #0d3d3d 100%); border-right: 1px solid rgba(255,255,255,0.1); z-index: 90; padding-top: 10px; overflow-y: auto; box-shadow: 2px 0 10px rgba(0,0,0,0.1); color: white;">
<style>
/* ── Mobile: off-canvas sidebar + visible hamburger/backdrop ── */
/* Below 768px, Odoo's own native "All Apps" burger menu already
gives full access to this app's sections (Dashboard, Master
Data, Students, ...) in its own drawer — see web.NavBar's
AppsMenu. A second, custom off-canvas sidebar here would just
duplicate that, so hide ours entirely on mobile instead. */
@media (max-width: 768px) {
#eduSidebarToggle { display: flex !important; }
.o_sidebar_custom {
transform: translateX(-100%);
transition: transform 0.25s ease;
width: 80vw !important;
max-width: 300px;
}
.o_sidebar_custom.o_sidebar_open { transform: translateX(0); }
.o_sidebar_backdrop.o_sidebar_open { display: block !important; }
.o_sidebar_custom { display: none !important; }
}
.o_sidebar_custom .sidebar-link {
display: flex; align-items: center; padding: 8px 16px;