diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index ac04fb4d1e1..8f35c81de2d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -80,6 +80,14 @@ * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image */ } +.openerp :-moz-placeholder { + color: #afafb6 !important; + font-style: italic !important; +} +.openerp ::-webkit-input-placeholder { + color: #afafb6 !important; + font-style: italic !important; +} .openerp a { text-decoration: none; } @@ -1808,15 +1816,29 @@ margin: 0 0 0 4px; padding: 0; } -.openerp .oe_view_nocontent > img { - float: left; - margin: 1.5em; -} -.openerp .oe_view_nocontent > div { - overflow: hidden; - padding: 35px 0px 0px 0px; - max-width: 700px; +.openerp .oe_view_nocontent { + padding: 15px; + margin-top: 0; + color: #777777; font-size: 125%; + max-width: 700px; +} +.openerp .oe_view_nocontent .oe_view_nocontent_create { + background: transparent url(/web/static/src/img/view_empty_arrow.png) no-repeat 7px 0; + margin-top: 0; + padding-top: 35px; + min-height: 28px; + color: #4c4c4c; +} +.openerp .oe_view_nocontent > p { + padding-left: 95px; +} +.openerp .oe_view_nocontent .oe_empty_custom_dashboard { + background: transparent url(/web/static/src/img/graph_background.png) no-repeat 0 0; + margin-top: -15px; + padding: 100px 0 0 137px; + min-height: 327px; + margin-left: -15px; } .openerp .oe_formview { background: white; @@ -1908,6 +1930,16 @@ max-width: 860px; margin: 0 auto; } +.openerp .oe_form div.oe_form_configuration div.oe_horizontal_separator { + margin: 25px 0 10px 0; +} +.openerp .oe_form div.oe_form_configuration p { + color: #aaaaaa; + max-width: 650px; +} +.openerp .oe_form div.oe_form_configuration label { + min-width: 150px; +} .openerp ul.oe_form_steps { height: 30px; padding: 0; @@ -2001,7 +2033,7 @@ } .openerp .oe_form td.oe_form_group_cell_label { border-right: 1px solid #dddddd; - padding: 2px 0px 2px 0px; + padding: 4px 0px 4px 0px; } .openerp .oe_form td.oe_form_group_cell_label label { line-height: 18px; @@ -2013,7 +2045,7 @@ } .openerp .oe_form .oe_form_group { width: 100%; - margin: 6px 0 6px 0; + margin: 9px 0 9px 0; } .openerp .oe_form .oe_form_group .oe_form_group_cell.oe_group_right { padding-left: 20px; @@ -2038,7 +2070,7 @@ font-weight: bold; font-size: 20px; margin: 8px 0px 8px 0px; - color: #aaaabb; + color: #53637e; } .openerp .oe_horizontal_separator:empty { height: 5px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 2698787c5a3..688c306169b 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -140,6 +140,14 @@ $sheet-max-width: 860px font-size: 13px background: white // }}} + //Placeholder style{{{ + \:-moz-placeholder + color: $facets-border !important + font-style: italic !important + \::-webkit-input-placeholder + color: $facets-border !important + font-style: italic !important + //}}} // Tag reset {{{ a text-decoration: none @@ -150,7 +158,7 @@ $sheet-max-width: 860px font-weight: bold background-color: #f0f0f0 th - border-right: 1px dotted #afafb6 + border-right: 1px dotted $facets-border &:last-child border-right: none th, td @@ -524,7 +532,7 @@ $sheet-max-width: 860px top: 26px left: 0 z-index: 1 - border: 1px solid #afafb6 + border: 1px solid $facets-border background: white padding: 4px 0 min-width: 140px @@ -804,7 +812,7 @@ $sheet-max-width: 860px display: none width: 220px background: #f0eeee - border-right: 1px solid #afafb6 + border-right: 1px solid $facets-border text-shadow: 0 1px 1px white padding-bottom: 16px a.oe_logo @@ -1245,7 +1253,7 @@ $sheet-max-width: 860px background-color: white min-width: 100% display: none - border: 1px solid #afafb6 + border: 1px solid $facets-border text-align: left @include radius(4px) @include box-shadow(0 1px 4px rgba(0,0,0,0.3)) @@ -1400,15 +1408,26 @@ $sheet-max-width: 860px // }}} // Views Common {{{ .oe_view_nocontent - > img - float: left - margin: 1.5em - > div - // don't encroach on my arrow - overflow: hidden - padding: 35px 0px 0px 0px - max-width: 700px - font-size: 125% + padding: 15px + margin-top: 0 + color: #777777 + font-size: 125% + max-width: 700px + .oe_view_nocontent_create + background: transparent url(/web/static/src/img/view_empty_arrow.png) no-repeat 7px 0 + margin-top: 0 + padding-top: 35px + min-height: 28px + color: #4c4c4c + > p + padding-left: 95px + .oe_empty_custom_dashboard + background: transparent url(/web/static/src/img/graph_background.png) no-repeat 0 0 + margin-top: -15px + padding: 100px 0 0 137px + min-height: 327px + margin-left: -15px + // }}} // FormView.base and dynamic tags {{{ .oe_formview @@ -1462,6 +1481,14 @@ $sheet-max-width: 860px min-width: 650px max-width: $sheet-max-width margin: 0 auto + div.oe_form_configuration + div.oe_horizontal_separator + margin: 25px 0 10px 0 + p + color: #aaa + max-width: 650px + label + min-width: 150px ul.oe_form_steps height: 30px padding: 0 @@ -1524,7 +1551,7 @@ $sheet-max-width: 860px background: white min-height: 330px padding: 16px - border: 1px solid #afafb6 + border: 1px solid $facets-border @include box-shadow(0 0 10px rgba(0,0,0,0.3)) .ui-tabs margin: 0 -16px @@ -1537,7 +1564,7 @@ $sheet-max-width: 860px margin: 2px td.oe_form_group_cell_label border-right: 1px solid #ddd - padding: 2px 0px 2px 0px + padding: 4px 0px 4px 0px label line-height: 18px display: block @@ -1546,7 +1573,7 @@ $sheet-max-width: 860px padding-left: 6px .oe_form_group width: 100% - margin: 6px 0 6px 0 + margin: 9px 0 9px 0 .oe_form_group_cell.oe_group_right padding-left: 20px // }}} @@ -1571,7 +1598,7 @@ $sheet-max-width: 860px font-weight: bold font-size: 20px margin: 8px 0px 8px 0px - color: #aab + color: #53637e .oe_horizontal_separator:empty height: 5px .oe_vertical_separator @@ -1905,7 +1932,7 @@ $sheet-max-width: 860px border-bottom: 2px solid #cacaca .treeview-tr, .treeview-td cursor: pointer - border-right: 1px dotted #afafb6 + border-right: 1px dotted $facets-border vertical-align: top text-align: left border-bottom: 1px solid #cfcccc diff --git a/addons/web/static/src/img/graph_background.png b/addons/web/static/src/img/graph_background.png new file mode 100644 index 00000000000..530312b20bb Binary files /dev/null and b/addons/web/static/src/img/graph_background.png differ diff --git a/addons/web/static/src/img/view_empty_arrow.png b/addons/web/static/src/img/view_empty_arrow.png index b0b1372adfd..ef8f3c820d7 100644 Binary files a/addons/web/static/src/img/view_empty_arrow.png and b/addons/web/static/src/img/view_empty_arrow.png differ diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 86fb457582d..694ffc3b722 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -609,6 +609,55 @@ instance.web.Login = instance.web.Widget.extend({ }); instance.web.client_actions.add("login", "instance.web.Login"); +/** + * Client action to reload the whole interface. + * If params has an entry 'menu_id', it opens the given menu entry. + */ +instance.web.Reload = instance.web.Widget.extend({ + init: function(parent, params) { + this._super(parent); + this.menu_id = (params && params.menu_id) || false; + }, + start: function() { + var l = window.location; + var timestamp = new Date().getTime(); + var search = "?ts=" + timestamp; + if (l.search) { + search = l.search + "&ts=" + timestamp; + } + var hash = l.hash; + if (this.menu_id) { + hash = "#menu_id=" + this.menu_id; + } + var url = l.protocol + "//" + l.host + l.pathname + search + hash; + window.location = url; + } +}); +instance.web.client_actions.add("reload", "instance.web.Reload"); + +/** + * Client action to go back in breadcrumb history. + * If can't go back in history stack, will go back to home. + */ +instance.web.HistoryBack = instance.web.Widget.extend({ + init: function(parent, params) { + if (!parent.history_back()) { + window.location = '/' + (window.location.search || ''); + } + } +}); +instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); + +/** + * Client action to go back home. + */ +instance.web.Home = instance.web.Widget.extend({ + init: function(parent, params) { + window.location = '/' + (window.location.search || ''); + } +}); +instance.web.client_actions.add("home", "instance.web.Home"); + instance.web.Menu = instance.web.Widget.extend({ template: 'Menu', init: function() { diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 2f2fb4f7832..6ba62162e93 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -672,32 +672,6 @@ instance.connection.on('module_loaded', this, function () { */ instance.web.client_actions = new instance.web.Registry(); -/** - * Client action to reload the whole interface. - * If params has an entry 'menu_id', it opens the given menu entry. - */ -instance.web.Reload = instance.web.Widget.extend({ - init: function(parent, params) { - this._super(parent); - this.menu_id = (params && params.menu_id) || false; - }, - start: function() { - var l = window.location; - var timestamp = new Date().getTime(); - var search = "?ts=" + timestamp; - if (l.search) { - search = l.search + "&ts=" + timestamp; - } - var hash = l.hash; - if (this.menu_id) { - hash = "#menu_id=" + this.menu_id; - } - var url = l.protocol + "//" + l.host + l.pathname + search + hash; - window.location = url; - } -}); -instance.web.client_actions.add("reload", "instance.web.Reload"); - }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 28427862377..76469461677 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -151,7 +151,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.sidebar.add_items('other', [ { label: _t('Delete'), callback: self.on_button_delete }, { label: _t('Duplicate'), callback: self.on_button_duplicate }, - { label: _t('Set Default'), callback: function (item) { self.open_defaults_dialog(); } }, + { label: _t('Set Default'), callback: function (item) { self.open_defaults_dialog(); } } ]); } @@ -686,8 +686,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, on_button_cancel: function(event) { if (this.can_be_discarded()) { - this.to_view_mode(); - this.on_record_loaded(this.datarecord); + if (this.get('actual_mode') === 'create') { + this.trigger('history_back'); + } else { + this.to_view_mode(); + this.on_record_loaded(this.datarecord); + } } return false; }, @@ -3628,7 +3632,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in $("textarea", this.$element).focusout(function() { self.$text.trigger("setInputData", ""); }).keydown(function(e) { - if (event.keyCode === 9 && self._drop_shown) { + if (e.which === $.ui.keyCode.TAB && self._drop_shown) { self.$text.textext()[0].autocomplete().selectFromDropdown(); } }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 9c7bf88db1a..57be3ca6db1 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -354,7 +354,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi this.sidebar.add_items('other', [ { label: _t("Import"), callback: this.on_sidebar_import }, { label: _t("Export"), callback: this.on_sidebar_export }, - { label: _t('Delete'), callback: this.do_delete_selected }, + { label: _t('Delete'), callback: this.do_delete_selected } ]); this.sidebar.add_toolbar(this.fields_view.toolbar); this.sidebar.$element.hide(); @@ -444,10 +444,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi id: '_group', tag: '', string: _t("Group"), meta: true, modifiers_for: function () { return {}; }, modifiers: {} - }, { - id: '_count', tag: '', string: '#', meta: true, - modifiers_for: function () { return {}; }, - modifiers: {} }); } @@ -880,9 +876,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi } this.$element.find('table:first').hide(); this.$element.prepend( - $('