From ffbd7480a419c52f2a2ec5409277e4a45a76e069 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 18 May 2012 13:12:02 +0200 Subject: [PATCH] [ADD] 'locked' icon on non-public custom filters Icon is kind-of crummy, but none of the iconic font's icons work, they're too small to work correctly (especially when using both locked and unlocked, they can't be distinguished below a font size of ~48) bzr revid: xmo@openerp.com-20120518111202-3h19grpq5cxgejg0 --- addons/web/static/src/css/base.css | 5 ++++- addons/web/static/src/css/base.sass | 6 +++++- addons/web/static/src/js/search.js | 4 +--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 8978dd3fc95..5dcc1f3b8a9 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1368,7 +1368,10 @@ cursor: pointer; position: relative; line-height: 1.2em; - padding: 2px 20px 2px 10px; + padding: 2px 20px 2px 25px; +} +.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom li.oe_searchview_custom_private { + background: url(/web/static/src/img/icons/terp-locked.png) 5px center no-repeat; } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom li:hover { background-color: #f0f0fa; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 84ac7cda6fa..ecade4ff30e 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1113,7 +1113,10 @@ $colour4: #8a89ba cursor: pointer position: relative line-height: 1.2em - padding: 2px 20px 2px 10px + padding: 2px 20px 2px 25px + + &.oe_searchview_custom_private + background: url(/web/static/src/img/icons/terp-locked.png) 5px center no-repeat &:hover background-color: $hover-background @@ -1123,6 +1126,7 @@ $colour4: #8a89ba top: 0 right: 5px + .oe_searchview_advanced form display: none diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 118eff17374..7d3f31f18de 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1597,9 +1597,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ }; // FIXME: current context? return self.model.call('create_or_replace', [filter]).then(function (id) { - if (id) { - filter.id = id; - } + filter.id = id; self.append_filter(filter); self.$element .removeClass('oe_opened')