diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index dab8e6070af..20454ea5d45 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -57,14 +57,14 @@ color: white; -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } .openerp2 .oe_topbar .oe_topbar_item .oe_active { background: #303030; font-weight: bold; color: white; -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } .openerp2 .oe_topbar .oe_topbar_avatar { width: 24px; height: 24px; @@ -128,14 +128,14 @@ color: white; -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } .openerp2 .oe_menu .oe_active { background: #303030; font-weight: bold; color: white; -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } .openerp2 .oe_secondary_menu_section { font-weight: bold; margin-left: 8px; @@ -169,7 +169,7 @@ border-radius: 4px; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } .openerp2 .oe_secondary_submenu .oe_active { background: #8a89ba; border-top: 1px solid lightGray; @@ -177,7 +177,7 @@ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } .openerp2 .oe_secondary_submenu .oe_active a { color: white; } .openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { @@ -186,7 +186,7 @@ text-shadow: 0 1px 1px white; -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } .openerp2 .oe_secondary_submenu .oe_menu_toggler:before { width: 0; height: 0; @@ -255,7 +255,7 @@ border-radius: 0 0 6px 6px; -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } @@ -280,4 +280,52 @@ background-image: linear-gradient(to bottom, #292929, #191919); -moz-box-shadow: none; -webkit-box-shadow: none; - -box-shadow: none; } + box-shadow: none; } + .openerp2 .oe_searchview { + position: relative; } + .openerp2 .oe_searchview .VS-search .VS-search-inner { + margin-right: 40px; } + .openerp2 .oe_searchview .VS-search .VS-icon-cancel { + right: 24px; } + .openerp2 .oe_searchview .VS-search .oe_vs_unfold_drawer { + position: absolute; + top: 0; + right: 0; + height: 100%; + line-height: 28px; + padding: 0 7px 0 4px; + color: #cccccc; + cursor: pointer; } + .openerp2 .oe_searchview .VS-search .oe_vs_unfold_drawer:before { + content: "▼"; } + .openerp2 .oe_searchview.oe_searchview_open_drawer .oe_searchview_drawer { + display: table; } + .openerp2 .oe_searchview .oe_searchview_drawer { + position: absolute; + top: 100%; + right: 0; + background-color: white; + width: 432px; + display: none; + border: 1px solid #cccccc; } + .openerp2 .oe_searchview .oe_searchview_drawer > div { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + display: table-cell; + width: 50%; } + .openerp2 .oe_searchview .oe_searchview_drawer h3 { + margin: 2px 4px 2px 8px; + color: #8786b7; } + .openerp2 .oe_searchview .oe_searchview_drawer ul { + margin: 0 12px 3px; + padding: 0; + list-style: none; } + .openerp2 .oe_searchview .oe_searchview_drawer li { + list-style: none; + padding: 3px 6px; + height: 14px; + color: inherit; + cursor: pointer; } + .openerp2 .oe_searchview .oe_searchview_drawer li:hover { + background-color: #f0f0fa; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 56a735c98fd..c4015fcf791 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1,4 +1,5 @@ // Variables {{{ +$section-title-color: #8786b7 $colour4: #8a89ba //$colour4: #d14836 // }}} @@ -29,7 +30,7 @@ $colour4: #8a89ba @mixin box-shadow($bsval: 0px 1px 4px #777) -moz-box-shadow: $bsval -webkit-box-shadow: $bsval - -box-shadow: $bsval + box-shadow: $bsval @mixin transition($transval: (border linear 0.2s, box-shadow linear 0.2s)) -webkit-transition: $transval @@ -46,6 +47,12 @@ $colour4: #8a89ba -webkit-background-clip: $clip -moz-background-clip: $clip background-clip: $clip + +@mixin unscrew-box + -moz-box-sizing: border-box + -webkit-box-sizing: border-box + box-sizing: border-box + // }}} .openerp2 @@ -322,6 +329,67 @@ $colour4: #8a89ba @include box-shadow(none) // }}} + // Search View {{{ + .oe_searchview + position: relative + + .VS-search + .VS-search-inner + margin-right: 40px + + .VS-icon-cancel + right: 24px + + .oe_vs_unfold_drawer + position: absolute + top: 0 + right: 0 + height: 100% + line-height: 28px + padding: 0 7px 0 4px + color: #ccc + cursor: pointer + &:before + content: "▼" + + &.oe_searchview_open_drawer + .oe_searchview_drawer + display: table + + .oe_searchview_drawer + position: absolute + top: 100% + right: 0 + background-color: white + width: 432px + display: none + border: 1px solid #ccc + + > div + @include unscrew-box + display: table-cell + width: 50% + + h3 + margin: 2px 4px 2px 8px + color: $section-title-color + + ul + margin: 0 12px 3px + padding: 0 + list-style: none + + li + list-style: none + padding: 3px 6px + height: 14px + color: inherit + cursor: pointer + + &:hover + background-color: #f0f0fa + // }}} + .openerp // Transitional overrides for old styles {{{ // }}} diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index dab85c03a1c..bdbe30b2bae 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -2,6 +2,9 @@ openerp.web.search = function(openerp) { var QWeb = openerp.web.qweb, _t = openerp.web._t, _lt = openerp.web._lt; +_.mixin({ + sum: function (obj) { return _.reduce(obj, function (a, b) { return a + b; }, 0); } +}); // Have SearchBox optionally use callback function to produce inputs and facets // (views) set on callbacks.make_facet and callbacks.make_input keys when @@ -48,7 +51,7 @@ var SearchBox_searchEvent = function (e) { }; if (SearchBox_searchEvent.toString() !== VS.ui.SearchBox.prototype.searchEvent.toString().replace( /this\.focusSearch\(e\);\n[ ]{4}this\.value\(query\)/, - 'this\.renderFacets();\n this\.focusSearch(e)')) { + 'this.renderFacets();\n this.focusSearch(e)')) { throw new Error( "Trying to replace wrong version of VS.ui.SearchBox#searchEvent. " + "Please fix replacement."); @@ -89,8 +92,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search this.has_defaults = !_.isEmpty(this.defaults); this.inputs = []; - - this.has_focus = false; + this.controls = {}; this.hidden = !!hidden; this.headless = this.hidden && !this.has_defaults; @@ -130,6 +132,11 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search context: this.dataset.get_context() }, this.on_loaded); } + + this.$element.on('click', '.oe_vs_unfold_drawer', function () { + self.$element.toggleClass('oe_searchview_open_drawer'); + }); + return $.when(p, this.ready); }, show: function () { @@ -139,6 +146,64 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search this.$element.hide(); }, + /** + * Sets up thingie where all the mess is put? + */ + setup_stuff_drawer: function () { + $('