From ba38d22f9d5584aa9d9222bdcac3cdab0148ba17 Mon Sep 17 00:00:00 2001 From: stefanorigano Date: Mon, 7 May 2018 17:21:25 +0200 Subject: [PATCH] [FIX] portal: nav in title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit fix an issue causing the portal navbar to overlap/inherit wrong style in customised websites. The previous layout used to add the entire portal navbar inside an

, causing inner elements to inherit the titles style. According to WC3 standards, titles can have phrasing content only. Titles reference > https://w3c.github.io/html-reference/h3.html Phrasing content reference > https://w3c.github.io/html-reference/common-models.html#common.elem.phrasing By chance this issue was not visible on runbot, but was severely affecting our website and probably clients ones too. This commit wrap the portal navbar in a standard bootstrap navbar structure, fixing the title issue and provinding some imp. too: - Search is now available for mobile - Modules can inject a custom/botstrap class (eg. navbar-default) ot customize design if needed --- addons/portal/static/src/less/portal.less | 71 ++++++++++- addons/portal/views/portal_templates.xml | 149 ++++++++++++---------- 2 files changed, 151 insertions(+), 69 deletions(-) diff --git a/addons/portal/static/src/less/portal.less b/addons/portal/static/src/less/portal.less index e6344b3d5d9..0e34d305fb5 100644 --- a/addons/portal/static/src/less/portal.less +++ b/addons/portal/static/src/less/portal.less @@ -289,11 +289,72 @@ img { } } - .o_portal_search_panel_fixed_width { - overflow: hidden; - max-width: 125px; - text-overflow: ellipsis; - white-space: nowrap; + .o_portal_navbar { + .navbar-brand { + margin: 0; + + @media (min-width: @grid-float-breakpoint) { + padding: @navbar-padding-vertical @navbar-padding-horizontal 0 0; + } + } + + // ===== Default portal navbar design ===== + &.o_portal_navbar_default { + margin-bottom: 8px; + + .navbar-brand { + padding: @navbar-padding-vertical @navbar-padding-horizontal 0 0; + } + + .navbar-header .dropdown-menu { + right: 0; + left: auto; + } + + .navbar-toggle { + margin-right: 0; + margin-bottom: 0; + background-color: @table-bg-active; + padding: 6px 10px @navbar-padding-vertical; + border: 1px solid @btn-default-border; + border-width: 1px 1px 0 1px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + z-index: 1; + + &.collapsed { + padding:6px 10px; + border-width: 1px; + border-radius: @btn-border-radius-base; + background-color: transparent; + } + } + + @media (max-width: @grid-float-breakpoint) { + .navbar-collapse { + z-index: 0; + box-shadow: inset 0 0 0 1px @btn-default-border; + background-color: @table-bg-active; + border-radius: @btn-border-radius-base; + border-top-right-radius: 0; + .o-transform(translateY(-2px)); + + &.in { + overflow: visible; + } + } + } + + @media (min-width: @grid-float-breakpoint) { + > .container-fluid { + padding: 0; + + .navbar-form { + padding-right: 0; + } + } + } + } } table.table tr { diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml index 6b79d009158..a242c9ef9ce 100644 --- a/addons/portal/views/portal_templates.xml +++ b/addons/portal/views/portal_templates.xml @@ -66,7 +66,7 @@