diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-07-10 17:42:05 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-07-15 13:32:56 +0200 |
| commit | 27df65c8782f998319374cddeead77ce8e994352 (patch) | |
| tree | a4e5d975210801387838fd4442644b3c781ddfd7 /addons/web/static/src | |
| parent | 45373eb1fcb8dc092ce75fffaf1baa7d476de2ab (diff) | |
[IMP] board,google_spreadsheet,web,web_calendar: Favorites menu
Adapt the Favorites menu so that addons appending stuff in it are compliant with
the enterprise edition.
Mainly, creation of dashboard.less from of dashboard.sass so that we can use mixins
defined in the web addon.
Some changes as well in the dashboard view to make it compliant with the enterprise
edition.
Use correct naming convention: classnames with underscores, less mixins with hyphens.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 15 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 17 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/search_menus.js | 18 | ||||
| -rw-r--r-- | addons/web/static/src/less/enterprise_compatibility.less | 36 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 8 |
5 files changed, 54 insertions, 40 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 37e68889f01..7852f764c19 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1289,13 +1289,6 @@ top: 3px; content: ""; } -.openerp .oe-search-options .open-menu a:before { - font-family: FontAwesome; - position: absolute; - left: 9px; - top: 3px; - content: ""; -} .openerp .oe-search-options .oe-select-group { margin: 3px 25px; } @@ -1506,16 +1499,16 @@ .openerp .oe_pivot .dropdown-menu .pivot-dropdown-submenu:hover > .dropdown-menu { display: block; } -.openerp .o-dashboard .oe_pivot th { +.openerp .o_dashboard .oe_pivot th { border-top: 1px solid #bfbfb6; } -.openerp .o-dashboard .oe_pivot th, .openerp .o-dashboard .oe_pivot .oe-closed, .openerp .o-dashboard .oe_pivot .oe-opened { +.openerp .o_dashboard .oe_pivot th, .openerp .o_dashboard .oe_pivot .oe-closed, .openerp .o_dashboard .oe_pivot .oe-opened { border-left: 1px solid #bfbfb6; } -.openerp .o-dashboard .oe_graph svg { +.openerp .o_dashboard .oe_graph svg { min-height: 250px; } -.openerp .o-dashboard .oe_graph .nv-pieLabels { +.openerp .o_dashboard .oe_graph .nv-pieLabels { display: none; } .openerp .oe_graph { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index fa4ea1c1ab6..d8248feb9ad 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1095,21 +1095,6 @@ $sheet-padding: 16px .filters-menu .divider display: list-item - .closed-menu - a:before - font-family: FontAwesome - position: absolute - left: 12px - top: 3px - content: "\f0da" - .open-menu - a:before - font-family: FontAwesome - position: absolute - left: 9px - top: 3px - content: "\f0d7" - .oe-select-group margin: 3px 25px .oe-add-group @@ -1283,7 +1268,7 @@ $sheet-padding: 16px .pivot-dropdown-submenu:hover > .dropdown-menu display: block - .o-dashboard + .o_dashboard .oe_pivot th border-top: 1px solid #bfbfb6 diff --git a/addons/web/static/src/js/views/search_menus.js b/addons/web/static/src/js/views/search_menus.js index a2f6c8970ef..faa67d890c2 100644 --- a/addons/web/static/src/js/views/search_menus.js +++ b/addons/web/static/src/js/views/search_menus.js @@ -68,10 +68,10 @@ return Widget.extend({ }, toggle_save_menu: function (is_open) { this.$save_search - .toggleClass('closed-menu', !(_.isUndefined(is_open)) ? !is_open : undefined) - .toggleClass('open-menu', is_open); + .toggleClass('o_closed_menu', !(_.isUndefined(is_open)) ? !is_open : undefined) + .toggleClass('o_open_menu', is_open); this.$save_name.toggle(is_open); - if (this.$save_search.hasClass('open-menu')) { + if (this.$save_search.hasClass('o_open_menu')) { this.$save_name.find('input').first().focus(); } }, @@ -320,10 +320,10 @@ return Widget.extend({ }, toggle_custom_filter_menu: function (is_open) { this.$add_filter - .toggleClass('closed-menu', !(_.isUndefined(is_open)) ? !is_open : undefined) - .toggleClass('open-menu', is_open); + .toggleClass('o_closed_menu', !(_.isUndefined(is_open)) ? !is_open : undefined) + .toggleClass('o_open_menu', is_open); this.$add_filter_menu.toggle(is_open); - if (this.$add_filter.hasClass('closed-menu') && (!this.propositions.length)) { + if (this.$add_filter.hasClass('o_closed_menu') && (!this.propositions.length)) { this.append_proposition(); } this.$('.oe-filter-condition').toggle(is_open); @@ -428,10 +428,10 @@ return Widget.extend({ }, toggle_add_menu: function (is_open) { this.$add_group - .toggleClass('closed-menu', !(_.isUndefined(is_open)) ? !is_open : undefined) - .toggleClass('open-menu', is_open); + .toggleClass('o_closed_menu', !(_.isUndefined(is_open)) ? !is_open : undefined) + .toggleClass('o_open_menu', is_open); this.$add_group_menu.toggle(is_open); - if (this.$add_group.hasClass('open-menu')) { + if (this.$add_group.hasClass('o_open_menu')) { this.$group_selector.focus(); } }, diff --git a/addons/web/static/src/less/enterprise_compatibility.less b/addons/web/static/src/less/enterprise_compatibility.less index 8d97c3b74d3..cd2468336a1 100644 --- a/addons/web/static/src/less/enterprise_compatibility.less +++ b/addons/web/static/src/less/enterprise_compatibility.less @@ -292,3 +292,39 @@ } } } + +// Search options dropdowns +.o-search-options-dropdown-custom-li() { + margin: 3px 25px; + width: auto; + max-width: 250px; + +} +// Open and closed carets in dropdowns +.o_closed_menu { + position: relative; + a:before { + .o-caret-right; + .o-position-absolute(@top: 50%, @left: 12px); + margin-top: (-@caret-width-base); + } +} +.o_open_menu { + position: relative; + a:before { + .o-caret-down; + .o-position-absolute(@top: 50%, @left: 9px); + margin-top: (-@caret-width-base); + } +} + +// Favorites Menu -> Add to my dashboard +.o_favorites_menu { + .o_add_to_dashboard_input { + .form-control(); + } + .o_add_to_dashboard_button { + .btn(); + .btn-default(); + } +} diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 35ae0919bf6..46805fe2c5e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1638,7 +1638,7 @@ <span class="fa fa-filter"/> Filters <span class="caret"/> </button> <ul class="dropdown-menu filters-menu" role="menu"> - <li class="oe-add-filter closed-menu"><a>Add Custom Filter</a></li> + <li class="oe-add-filter o_closed_menu"><a>Add Custom Filter</a></li> <li class="oe-add-filter-menu"><button type="button" class="btn btn-default oe-apply-filter">Apply</button><a class="oe-add-condition"><span class="fa fa-plus-circle"/> Add a condition</a></li> </ul> </div> @@ -1649,7 +1649,7 @@ </button> <ul class="dropdown-menu group-by-menu" role="menu"> <li class="divider"/> - <li class="add-custom-group closed-menu"><a>Add custom group</a></li> + <li class="add-custom-group o_closed_menu"><a>Add custom group</a></li> </ul> </div> @@ -1665,9 +1665,9 @@ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="fa fa-star"/> Favorites <span class="caret"/> </button> - <ul class="dropdown-menu favorites-menu" role="menu"> + <ul class="dropdown-menu o_favorites_menu" role="menu"> <li class="divider"/> - <li class="oe-save-search closed-menu"><a>Save current search</a></li> + <li class="oe-save-search o_closed_menu"><a>Save current search</a></li> <li class="oe-save-name"><input type="text" class="form-control"></input></li> <li class="oe-save-name"> <span><input type="checkbox"/>Use by default</span> |
