From fb29a53a6ba22337bda2e9e21f827f95dfa370f5 Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Sat, 15 Oct 2016 05:51:00 -0700 Subject: [PATCH] [FIX] web_responsive: Add logo, fix modularity & style * Add style to hide oe_footer instead of remove to not break `support_branding` * Add company logo and editing to App Drawer title bar * Remove translation and screen reader from glyphs * Minor style fixes on app drawer toggle button positioning * Add note in ReadMe explaining override of `support_branding` * Add note in ReadMe explaining why no `oe_main_menu_navbar` --- web_responsive/README.rst | 6 +++ .../static/src/js/web_responsive.js | 4 +- .../static/src/less/app_drawer.less | 24 ++++++++++- web_responsive/static/src/less/main.less | 4 ++ web_responsive/views/web.xml | 41 ++++++++++++++----- 5 files changed, 66 insertions(+), 13 deletions(-) diff --git a/web_responsive/README.rst b/web_responsive/README.rst index 9b76a2ff..7981266f 100755 --- a/web_responsive/README.rst +++ b/web_responsive/README.rst @@ -40,12 +40,18 @@ The following keyboard shortcuts are implemented: Known issues / Roadmap ====================== +Note: Data added to the footer ``support_branding`` is not shown while using +this module. + * Provide full menu search feature instead of just App search * Drag drawer from left to open in mobile * Figure out how to test focus on hidden elements for keyboard nav tests * If you resize the window, body gets a wrong ``overflow: auto`` css property and you need to refresh your view or open/close the app drawer to fix that. * Override LESS styling to allow for responsive widget layouts +* Adding ``oe_main_menu_navbar`` ID to the top navigation bar triggers some + great styles, but also `JavaScript that causes issues on mobile + `_ Bug Tracker =========== diff --git a/web_responsive/static/src/js/web_responsive.js b/web_responsive/static/src/js/web_responsive.js index db4851bb..527b5501 100755 --- a/web_responsive/static/src/js/web_responsive.js +++ b/web_responsive/static/src/js/web_responsive.js @@ -85,7 +85,9 @@ odoo.define('web_responsive', function(require) { this.initDrawer(); var $clickZones = $('.openerp_webclient_container, ' + 'a.oe_menu_leaf, ' + - 'a.oe_menu_toggler' + 'a.oe_menu_toggler, ' + + 'a.oe_logo, ' + + 'i.oe_logo_edit' ); $clickZones.click($.proxy(this.handleClickZones, this)); core.bus.on('resize', this, this.handleWindowResize); diff --git a/web_responsive/static/src/less/app_drawer.less b/web_responsive/static/src/less/app_drawer.less index 506ec0ee..127f25de 100755 --- a/web_responsive/static/src/less/app_drawer.less +++ b/web_responsive/static/src/less/app_drawer.less @@ -11,7 +11,27 @@ border-radius: @border-radius-base; .box-shadow(0 6px 12px rgba(0, 0, 0, .175)); background-clip: padding-box; - + + .oe_logo { + img { + margin-top: -@app-drawer-navbar-padding-vertical; + height: @app-drawer-title-height; + } + .oe_logo_edit { + position: absolute; + top: 1px; + width: 100%; + padding: 4px; + margin: 14px 0; + display: none; + color: #eee; + background: rgba(37,37,37,0.9); + } + &:hover .oe_logo_edit_admin { + display: block; + } + } + .navbar-left { width: 100%; @@ -25,7 +45,7 @@ } .app-drawer-panel-title { - margin-top: 4px; + margin-top: 5px; } .app-drawer-icon-app { diff --git a/web_responsive/static/src/less/main.less b/web_responsive/static/src/less/main.less index ca2e3236..246e9d81 100755 --- a/web_responsive/static/src/less/main.less +++ b/web_responsive/static/src/less/main.less @@ -21,3 +21,7 @@ main { height: 100%; overflow: hidden; } + +div.oe_footer { + display: none; +} diff --git a/web_responsive/views/web.xml b/web_responsive/views/web.xml index 6c207810..4921f12d 100644 --- a/web_responsive/views/web.xml +++ b/web_responsive/views/web.xml @@ -45,7 +45,10 @@ accesskey="A" > Toggle App Drawer - +