From 23207c806670ced81733492c2287d3a1148c6726 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 20 Apr 2012 19:44:27 +0200 Subject: [PATCH 01/51] [IMP] Listview styling bzr revid: al@openerp.com-20120420174427-unoupanegd83equ4 --- addons/web/static/src/css/base.css | 118 ++++++++++++++++---------- addons/web/static/src/css/base.sass | 92 +++++++++++--------- addons/web/static/src/js/view_list.js | 7 +- addons/web/static/src/xml/base.xml | 2 +- 4 files changed, 129 insertions(+), 90 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2b90d47c002..22d3990700c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1629,46 +1629,6 @@ .openerp .oe-listview-content { width: 100%; } -.openerp .oe-listview-content thead, .openerp .oe-listview-content tfoot { - border-bottom: 1px solid #cacaca; - background: #eeeeee; -} -.openerp .oe-listview-content tfoot { - border-bottom: 1px solid #cacaca; - font-weight: bold; -} -.openerp .oe-listview-content tbody { - cursor: pointer; - background: white; -} -.openerp .oe-listview-content thead { - vertical-align: top; -} -.openerp .oe-listview-content td.oe_list_checkbox:first-child, .openerp .oe-listview-content th.oe_list_checkbox:first-child { - width: 17px; -} -.openerp .oe-listview-content td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content th.oe_list_checkbox:first-child:after { - border-width: 0; -} -.openerp .oe-listview-content tbody tr:nth-child(odd) td, .openerp .oe-listview-content tbody tr:nth-child(odd) th { - background-color: #f0f0fa; - background-color: #f0f0fa; - background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); - background-image: -webkit-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -moz-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -ms-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: -o-linear-gradient(top, #f0f0fa, #eeeef6); - background-image: linear-gradient(to bottom, #f0f0fa, #eeeef6); -} -.openerp .oe-listview-content tbody tr:hover td, .openerp .oe-listview-content tbody tr:hover th { - background-color: #eeeeee; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dedede)); - background-image: -webkit-linear-gradient(top, #eeeeee, #dedede); - background-image: -moz-linear-gradient(top, #eeeeee, #dedede); - background-image: -ms-linear-gradient(top, #eeeeee, #dedede); - background-image: -o-linear-gradient(top, #eeeeee, #dedede); - background-image: linear-gradient(to bottom, #eeeeee, #dedede); -} .openerp .oe-listview-content td, .openerp .oe-listview-content th { padding: 3px 6px; line-height: 18px; @@ -1681,19 +1641,26 @@ -webkit-box-shadow: none; -box-shadow: none; } -.openerp .oe-listview-content .numeric { - text-align: right; - width: 82px; +.openerp .oe-listview-content thead { + border-bottom: 2px solid #cacaca; + background: #eeeeee; + vertical-align: top; } -.openerp .oe-listview-content .numeric input { - text-align: right; +.openerp .oe-listview-content thead th:after { + content: ""; + float: right; + margin-top: 7px; + border-width: 0 4px 4px; + border-style: solid; + border-color: black transparent; + visibility: hidden; } -.openerp .oe-listview-content table .sortdown:after, .openerp .oe-listview-content table .sortdown:hover:after { +.openerp .oe-listview-content thead th.sortup:after { visibility: visible; filter: alpha(opacity=60); opacity: 0.6; } -.openerp .oe-listview-content table .sortup:after { +.openerp .oe-listview-content thead th.sortdown:after { border-bottom: none; border-left: 4px solid transparent; border-right: 4px solid transparent; @@ -1705,6 +1672,63 @@ filter: alpha(opacity=60); opacity: 0.6; } +.openerp .oe-listview-content thead th:hover:after { + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid black; + visibility: visible; + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; + filter: alpha(opacity=60); + opacity: 0.6; +} +.openerp .oe-listview-content tbody { + cursor: pointer; + background: white; +} +.openerp .oe-listview-content tbody tr { + border-top: 1px solid #dddddd; +} +.openerp .oe-listview-content tbody tr:nth-child(odd) { + background-color: #f0f0fa; + background-color: #f0f0fa; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); + background-image: -webkit-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -moz-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -ms-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: -o-linear-gradient(top, #f0f0fa, #eeeef6); + background-image: linear-gradient(to bottom, #f0f0fa, #eeeef6); +} +.openerp .oe-listview-content tfoot { + border-top: 2px solid #cacaca; + border-bottom: 1px solid #cacaca; + background: #eeeeee; + font-weight: bold; +} +.openerp .oe-listview-content tbody tr:hover td, .openerp .oe-listview-content tbody tr:hover th { + background-color: #eeeeee; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#dedede)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dedede); + background-image: -moz-linear-gradient(top, #eeeeee, #dedede); + background-image: -ms-linear-gradient(top, #eeeeee, #dedede); + background-image: -o-linear-gradient(top, #eeeeee, #dedede); + background-image: linear-gradient(to bottom, #eeeeee, #dedede); +} +.openerp .oe-listview-content td.oe_list_checkbox:first-child, .openerp .oe-listview-content th.oe_list_checkbox:first-child { + width: 17px; +} +.openerp .oe-listview-content td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content th.oe_list_checkbox:first-child:after { + border-width: 0; +} +.openerp .oe-listview-content .numeric { + text-align: right; + width: 82px; +} +.openerp .oe-listview-content .numeric input { + text-align: right; +} .openerp .oe_kanban_group_title { margin: 1px 1px 4px; font-size: 15px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index fc645a92e44..db999f2598c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1375,26 +1375,6 @@ $colour4: #8a89ba font-size: 125% .oe-listview-content width: 100% - thead, tfoot - border-bottom: 1px solid #cacaca - background: #eee - tfoot - border-bottom: 1px solid #cacaca - font-weight: bold - tbody - cursor: pointer - background: white - thead - vertical-align: top - td.oe_list_checkbox:first-child, th.oe_list_checkbox:first-child - width: 17px - &:after - border-width: 0 - tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th - background-color: #f0f0fa - @include vertical-gradient(#f0f0fa, #eeeef6) - tbody tr:hover td, tbody tr:hover th - @include vertical-gradient(#eee, #dedede) td, th padding: 3px 6px line-height: 18px @@ -1403,30 +1383,64 @@ $colour4: #8a89ba background: transparent padding: 0 @include box-shadow(none) + thead + border-bottom: 2px solid #cacaca + background: #eee + vertical-align: top + th:after + content: "" + float: right + margin-top: 7px + border-width: 0 4px 4px + border-style: solid + border-color: #000 transparent + visibility: hidden + th.sortup:after + visibility: visible + @include opacity(0.6) + th.sortdown:after + border-bottom: none + border-left: 4px solid transparent + border-right: 4px solid transparent + border-top: 4px solid #000 + visibility: visible + @include box-shadow(none) + @include opacity(0.6) + // TODO mit + //th:hover:after + // border-bottom: none + // border-left: 4px solid transparent + // border-right: 4px solid transparent + // border-top: 4px solid #000 + // visibility: visible + // @include box-shadow(none) + // @include opacity(0.6) + tbody + cursor: pointer + background: white + tr + border-top: 1px solid #ddd + tr:nth-child(odd) + background-color: #f0f0fa + @include vertical-gradient(#f0f0fa, #eeeef6) + tfoot + border-top: 2px solid #cacaca + border-bottom: 1px solid #cacaca + background: #eee + font-weight: bold + + tbody tr:hover td, tbody tr:hover th + @include vertical-gradient(#eee, #dedede) + + td.oe_list_checkbox:first-child, th.oe_list_checkbox:first-child + width: 17px + &:after + border-width: 0 .numeric text-align: right width: 82px input text-align: right - //thead th:after - //content: "" - //float: right - //margin-top: 7px - //border-width: 0 4px 4px - //border-style: solid - //border-color: #000 transparent - //visibility: hidden - table .sortdown:after, table .sortdown:hover:after - visibility: visible - @include opacity(0.6) - table .sortup:after - border-bottom: none - border-left: 4px solid transparent - border-right: 4px solid transparent - border-top: 4px solid #000 - visibility: visible - @include box-shadow(none) - @include opacity(0.6) // }}} // KanbanView {{{ .oe_kanban_group_title diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 1fa3ca4fcee..ced727987b4 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -256,11 +256,12 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi e.stopPropagation(); var $this = $(this); self.dataset.sort($this.data('id')); - if ($this.find('span').length) { - $this.find('span').toggleClass( 'ui-icon-triangle-1-s ui-icon-triangle-1-n'); + if($this.hasClass("sortdown") || $this.hasClass("sortup")) { + $this.toggleClass("sortdown").toggleClass("sortup"); } else { - $this.append('') .siblings('.oe-sortable').find('span').remove(); + $this.toggleClass("sortdown"); } + $this.siblings('.oe-sortable').removeClass("sortup sortdown"); self.reload_content(); }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 57970c1486e..64998b4d40b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -607,7 +607,7 @@ - + + - - - + +
From 7ced323a0e23840118f643ee3d0e6f02c7059f60 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 20 Apr 2012 20:07:38 +0200 Subject: [PATCH 02/51] [FIX] view manager margin bzr revid: al@openerp.com-20120420180738-8pu70704j4niu4w3 --- addons/web/static/src/css/base.css | 25 +++++++++---------------- addons/web/static/src/css/base.sass | 9 ++++++--- addons/web/static/src/xml/base.xml | 28 ++++++++++++++++++++++------ 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 22d3990700c..439d8e8d0e8 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -859,6 +859,15 @@ -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 9px rgba(0, 0, 0, 0.1); -box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 9px rgba(0, 0, 0, 0.1); } +.openerp .oe_view_manager_header2 .oe_view_manager_header2_row1 { + margin: 8px; +} +.openerp .oe_view_manager_header2 .oe_view_manager_header2_row2 { + margin: 8px; +} +.openerp .oe_view_manager_header2 td { + line-height: 26px; +} .openerp .oe_view_manager_header2 h2 { float: left; font-size: 18px; @@ -867,10 +876,6 @@ .openerp .oe_view_manager_header2 h2 a { color: #8a89ba; } -.openerp .oe_view_manager_header2 td { - padding: 4px 8px; - line-height: 26px; -} .openerp .oe_view_manager_header2 .oe_button_group { display: inline-block; border: 1px solid #ababab; @@ -1672,18 +1677,6 @@ filter: alpha(opacity=60); opacity: 0.6; } -.openerp .oe-listview-content thead th:hover:after { - border-bottom: none; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid black; - visibility: visible; - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; - filter: alpha(opacity=60); - opacity: 0.6; -} .openerp .oe-listview-content tbody { cursor: pointer; background: white; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index db999f2598c..8c726576a79 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -675,15 +675,18 @@ $colour4: #8a89ba border-bottom: 1px solid #cacaca @include vertical-gradient(#fcfcfc, #dedede) @include box-shadow((0 1px 0 rgba(255,255,255,0.4), 0 0 9px rgba(0,0,0,0.1))) + .oe_view_manager_header2_row1 + margin: 8px + .oe_view_manager_header2_row2 + margin: 8px + td + line-height: 26px h2 float: left font-size: 18px margin: 1px 0 a color: $colour4 - td - padding: 4px 8px - line-height: 26px .oe_button_group display: inline-block border: 1px solid #ababab diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 64998b4d40b..c1b5e2e598a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -413,16 +413,31 @@
-

- -

+
+

+ +

+
+
+
+
+
+
+
+
+
+
+
+
+
From 6a982c90150d2095eebbe320a898ebbbb5a3b5d1 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 20 Apr 2012 20:27:15 +0200 Subject: [PATCH 03/51] [IMP] misc chrome css bzr revid: al@openerp.com-20120420182715-9w1aqwbmcvmvjrug --- addons/web/static/src/css/base.css | 9 ++++++++- addons/web/static/src/css/base.sass | 8 +++++++- addons/web/static/src/xml/base.xml | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 439d8e8d0e8..deb677151a0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -107,6 +107,12 @@ .openerp .oe_wait { cursor: wait; } +.openerp .oe_fade { + color: #888888; +} +.openerp .oe_bold { + font-weight: bold; +} .openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp input[type='submit'] { display: inline-block; border: 1px solid #ababab; @@ -500,6 +506,7 @@ background: #f0eeee; border-right: 1px solid #afafb6; text-shadow: 0 1px 1px white; + padding-bottom: 16px; } .openerp a.oe_logo { width: 220px; @@ -728,7 +735,7 @@ content: "&darr"; text-indent: -99999px; vertical-align: top; - margin-left: -8px; + margin-left: -12px; margin-top: 4px; margin-right: 4px; border-top: 4px solid transparent; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 8c726576a79..96025c2461e 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -133,6 +133,11 @@ $colour4: #8a89ba clear: both .oe_wait cursor: wait + .oe_fade + color: #888 + //font-size: 12px + .oe_bold + font-weight: bold // }}} // Button style {{{ a.button:link, a.button:visited, button, input[type='submit'] @@ -408,6 +413,7 @@ $colour4: #8a89ba background: #f0eeee border-right: 1px solid #afafb6 text-shadow: 0 1px 1px white + padding-bottom: 16px a.oe_logo width: 220px display: block @@ -580,7 +586,7 @@ $colour4: #8a89ba content: "&darr" text-indent: -99999px vertical-align: top - margin-left: -8px + margin-left: -12px margin-top: 4px margin-right: 4px border-top: 4px solid transparent diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c1b5e2e598a..1082f84b51b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -731,8 +731,7 @@
- or - Discard + or Discard From fcfd73cb573fcee16c2c740a8c10852df386e9b1 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 00:11:50 +0200 Subject: [PATCH 04/51] usermenu rename templates, only show db in debug, only show company in multicompany bzr revid: al@openerp.com-20120427221150-j3resq34s4mkazd6 --- addons/web/static/src/js/chrome.js | 11 ++++--- addons/web/static/src/xml/base.xml | 50 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f43da0431ff..1a98874c306 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -712,7 +712,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ title: _t("Change Password"), width : 'auto' }).open(); - this.dialog.$element.html(QWeb.render("Change_Pwd", self)); + this.dialog.$element.html(QWeb.render("UserMenu.password", self)); this.dialog.$element.find("form[name=change_password_form]").validate({ submitHandler: function (form) { self.rpc("/web/session/change_password",{ @@ -746,8 +746,11 @@ instance.web.UserMenu = instance.web.Widget.extend({ return; var func = new instance.web.Model("res.users").get_func("read"); return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { - // TODO: Show company if multicompany is in use - var topbar_name = _.str.sprintf("%s (%s)", res.name, instance.connection.db, res.company_id[1]); + var topbar_name = res.name; + if(instance.connection.debug) + topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.connection.db); + if(res.company_id[0] > 1) + topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]); self.$element.find('.oe_topbar_name').text(topbar_name); var avatar_src = _.str.sprintf('%s/web/binary/image?session_id=%s&model=res.users&field=avatar&id=%s', self.session.prefix, self.session.session_id, self.session.uid); $avatar.attr('src', avatar_src); @@ -850,7 +853,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ on_menu_about: function() { var self = this; self.rpc("/web/webclient/version_info", {}).then(function(res) { - var $help = $(QWeb.render("About-Page", {version_info: res})); + var $help = $(QWeb.render("UserMenu.about", {version_info: res})); $help.find('a.oe_activate_debug_mode').click(function (e) { e.preventDefault(); window.location = $.param.querystring( diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 800c6dadf90..ef044388155 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -264,29 +264,6 @@ - - - - - - - - - -
-
-
-
-
- -
- -
-
-
-
  • @@ -363,7 +340,7 @@
  • - +
    Activate the developper mode

    OpenERP

    @@ -380,7 +357,7 @@

    - +
    @@ -405,6 +382,29 @@ + +
    + + + + + + + +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    From 43ee750680e7b627c5054a59b8b816f27902807e Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 00:14:43 +0200 Subject: [PATCH 05/51] remove search prefix bzr revid: al@openerp.com-20120427221443-alf3wrsn1dyrkjsv --- addons/web/static/src/js/views.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 798c5bb1493..f25c4381d28 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -649,15 +649,6 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ self.$element.find('.oe_view_title_text').text(fvg.arch.attrs.string || fvg.name); } - var $title = self.$element.find('.oe_view_title_text'), - $search_prefix = $title.find('span.oe_searchable_view'); - if (controller.searchable !== false && self.flags.search_view !== false) { - if (!$search_prefix.length) { - $title.prepend('' + _t("Search: ") + ''); - } - } else { - $search_prefix.remove(); - } }); }, do_push_state: function(state) { From 7f06b9787ddf4805eebc6a5e9794cda07d1dcca1 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 00:30:08 +0200 Subject: [PATCH 06/51] usermenu move about, hr styling bzr revid: al@openerp.com-20120427223008-9zo5mzz085wtco2k --- addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/css/base.sass | 3 +++ addons/web/static/src/xml/base.xml | 4 +--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 7d5893a39f3..68eb85e00bc 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -603,6 +603,10 @@ -webkit-box-shadow: none; -box-shadow: none; } +.openerp .oe_user_menu .oe_dropdown_options li hr { + border-top: 1px solid #999999; + border-bottom: 0; +} .openerp .oe_menu { float: left; padding: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index acc2ab59a3d..687eb769cb7 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -485,6 +485,9 @@ $colour4: #8a89ba &:hover @include vertical-gradient(#292929, #191919) @include box-shadow(none) + hr + border-top: 1px solid #999 + border-bottom: 0 // }}} // Menu {{{ .oe_menu diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index ef044388155..2cb0907f390 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -323,12 +323,10 @@ From f4dd5a2a2c5f2214a2c183c61196a63e9e954ffa Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 00:33:54 +0200 Subject: [PATCH 07/51] view manager switch use tipsy bzr revid: al@openerp.com-20120427223354-nl5v30rn2xwhymnk --- addons/web/static/src/js/views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f25c4381d28..811318b145a 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -237,7 +237,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ var self = this; this.$element.find('.oe_view_manager_switch a').click(function() { self.on_mode_switch($(this).data('view-type')); - }); + }).tipsy(); var views_ids = {}; _.each(this.views_src, function(view) { self.views[view.view_type] = $.extend({}, view, { From ed8a1c688c8c3ea52c0d1e409dd44fa692ff570d Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 00:47:55 +0200 Subject: [PATCH 08/51] o2m form popup hide pager bzr revid: al@openerp.com-20120427224755-3pst1cmnxd6g9dno --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 17 ++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 68eb85e00bc..4faee96aac6 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1639,6 +1639,9 @@ height: auto; line-height: 16px; } +.openerp .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager { + display: none; +} .openerp .oe_form .oe_form_title, .openerp .oe_form .oe_form_title input { font-size: 20px; font-weight: bold; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 687eb769cb7..08ce0d40144 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1101,21 +1101,6 @@ $colour4: #8a89ba min-height: 420px border: 1px solid #afafb6 @include box-shadow(0 0 10px rgba(0,0,0,0.3)) - //.avatar - // max-height: 52px - //.contacts - // li - // float: left - // width: 33% - // margin-bottom: 4px - // .avatar - // height: 40px - // width: 40px - // border: 1px solid - // border-color: #e5e5e5 #dbdbdb #d2d2d2 - // .data - // padding: 2px - // line-height: 18px // }}} // FormView.autolayout {{{ .oe_form_autolayout @@ -1378,6 +1363,8 @@ $colour4: #8a89ba li height: auto line-height: 16px + .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager + display: none // }}} // FormView.classes for openerp views {{{ From d3c48fca122e88e3fa8424aaa19c009fddaf783f Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 01:18:52 +0200 Subject: [PATCH 09/51] form move delete and duplicate in more bzr revid: al@openerp.com-20120427231852-rsu3f4huxhv8c38v --- addons/web/static/src/js/view_form.js | 23 ++++-------------- addons/web/static/src/js/views.js | 35 ++++++++++++--------------- addons/web/static/src/xml/base.xml | 2 -- 3 files changed, 21 insertions(+), 39 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3c15e845f56..649b7b38a7b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -90,8 +90,6 @@ instance.web.FormView = instance.web.View.extend({ } this.$buttons.on('click','.oe_form_button_create',this.on_button_create); this.$buttons.on('click','.oe_form_button_edit',this.on_button_edit); - this.$buttons.on('click','.oe_form_button_duplicate',this.on_button_duplicate); - this.$buttons.on('click','.oe_form_button_delete',this.on_button_delete); this.$buttons.on('click','.oe_form_button_save',this.on_button_save); this.$buttons.on('click','.oe_form_button_cancel',this.on_button_cancel); @@ -112,13 +110,11 @@ instance.web.FormView = instance.web.View.extend({ if(this.fields_view.toolbar) { this.sidebar.add_toolbar(this.fields_view.toolbar); } - this.sidebar.add_items('other', [{ - label: _t('Set Default'), - form: this, - callback: function (item) { - item.form.open_defaults_dialog(); - } - }]); + 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(); } }, + ]); } this.on("change:mode", this, this.switch_mode); this.set({mode: this.options.initial_mode}); @@ -865,15 +861,6 @@ instance.web.FormView = instance.web.View.extend({ }, }); -/** - * Interface to be implemented by rendering engines for the form view. - */ -instance.web.form.FormRenderingEngineInterface = { - set_fields_view: function(fields_view) {}, - set_fields_registry: function(fields_registry) {}, - render_to: function($element) {}, -}; - /** * Default rendering engine for the form view. * diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 811318b145a..7e7256f2d5d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -768,25 +768,6 @@ instance.web.Sidebar = instance.web.Widget.extend({ self.$element.html(QWeb.render('Sidebar', {widget: self})); this.$element.find('ul').hide(); }, - add_section: function() { - var self = this; - }, - add_toolbar: function(toolbar) { - var self = this; - _.each(['print','action','relate'], function(type) { - var items = toolbar[type]; - if (items) { - for (var i = 0; i < items.length; i++) { - items[i] = { - label: items[i]['name'], - action: items[i], - classname: 'oe_sidebar_' + type - } - } - self.add_items(type=='print' ? 'print' : 'other', items); - } - }); - }, /** * For each item added to the section: * @@ -819,6 +800,22 @@ instance.web.Sidebar = instance.web.Widget.extend({ this.redraw(); } }, + add_toolbar: function(toolbar) { + var self = this; + _.each(['print','action','relate'], function(type) { + var items = toolbar[type]; + if (items) { + for (var i = 0; i < items.length; i++) { + items[i] = { + label: items[i]['name'], + action: items[i], + classname: 'oe_sidebar_' + type + } + } + self.add_items(type=='print' ? 'print' : 'other', items); + } + }); + }, on_item_action_clicked: function(item) { var self = this; self.getParent().sidebar_context().then(function (context) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 2cb0907f390..6fbbadf7adb 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -725,8 +725,6 @@ - - or Discard From 40091fe2bfefb10ff51be4a876eae6aa44ac96c2 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 01:41:19 +0200 Subject: [PATCH 10/51] form hide sidebar in edit mode bzr revid: al@openerp.com-20120427234119-6qzy2essj12d63n4 --- addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/css/base.sass | 3 +++ addons/web/static/src/js/view_form.js | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 4faee96aac6..c960b6ed39d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1513,6 +1513,10 @@ right: 5px; top: 3px; } +.openerp .oe_form .oe_form_button > img { + vertical-align: -3px; + padding: 0 2px; +} .openerp .oe_form .oe-binary-file-set { overflow: hidden; position: relative; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 08ce0d40144..63ed68a7b67 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1242,6 +1242,9 @@ $colour4: #8a89ba filter: alpha(opacity=50) right: 5px top: 3px + .oe_form_button > img + vertical-align: -3px + padding: 0 2px // }}} // FormView.binaryfile {{{ /* http://www.quirksmode.org/dom/inputfile.html diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 649b7b38a7b..53038ff1e11 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -80,7 +80,6 @@ instance.web.FormView = instance.web.View.extend({ this.rendering_engine.render_to($dest); } - this.$sidebar = this.options.$sidebar || this.$element.find('.oe_form_sidebar'); this.$buttons = $(QWeb.render("FormView.buttons", {'widget':self})); if (this.options.$buttons) { @@ -104,6 +103,7 @@ instance.web.FormView = instance.web.View.extend({ self.on_pager_action(action); }); + this.$sidebar = this.options.$sidebar || this.$element.find('.oe_form_sidebar'); if (!this.sidebar && this.options.$sidebar) { this.sidebar = new instance.web.Sidebar(this); this.sidebar.appendTo(this.$sidebar); @@ -497,12 +497,14 @@ instance.web.FormView = instance.web.View.extend({ if(this.get("mode") == "view") { self.$buttons.find('.oe_form_buttons_edit').hide(); self.$buttons.find('.oe_form_buttons_view').show(); + self.$sidebar.show(); _.each(this.fields,function(field){ field.set({"force_readonly": true}); }); } else { self.$buttons.find('.oe_form_buttons_edit').show(); self.$buttons.find('.oe_form_buttons_view').hide(); + self.$sidebar.hide(); _.each(this.fields,function(field){ field.set({"force_readonly": false}); }); From 563ba21620585ae4a8d007757ccc214929e623a9 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 28 Apr 2012 03:23:04 +0200 Subject: [PATCH 11/51] user_menu preferences, viewmanager css, menu empty needactions bzr revid: al@openerp.com-20120428012304-8z27jmbo7vgn380q --- addons/web/static/src/css/base.css | 5 ++--- addons/web/static/src/css/base.sass | 5 ++--- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/view_form.js | 6 ++++-- addons/web/static/src/xml/base.xml | 14 +++++++------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c960b6ed39d..26f77c739d4 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -432,7 +432,6 @@ width: 100%; height: 31px; border-top: solid 1px #d3d3d3; - border-bottom: solid 1px black; background-color: #646060; background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); background-image: -webkit-linear-gradient(top, #646060, #262626); @@ -874,13 +873,12 @@ margin: 8px; } .openerp .oe_view_manager_header2 .oe_view_manager_header2_row2 { - margin: 8px; + margin: 0 8px 8px 8px; } .openerp .oe_view_manager_header2 td { line-height: 26px; } .openerp .oe_view_manager_header2 h2 { - float: left; font-size: 18px; margin: 1px 0; } @@ -1044,6 +1042,7 @@ line-height: 14px; color: #4c4c4c; text-decoration: none; + cursor: pointer; } .openerp .oe_dropdown_menu li a:hover { text-decoration: none; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 63ed68a7b67..e9890bcc922 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -356,7 +356,6 @@ $colour4: #8a89ba width: 100% height: 31px border-top: solid 1px #d3d3d3 - border-bottom: solid 1px black @include vertical-gradient(#646060, #262626) .oe_systray @@ -687,11 +686,10 @@ $colour4: #8a89ba .oe_view_manager_header2_row1 margin: 8px .oe_view_manager_header2_row2 - margin: 8px + margin: 0 8px 8px 8px td line-height: 26px h2 - float: left font-size: 18px margin: 1px 0 a @@ -822,6 +820,7 @@ $colour4: #8a89ba line-height: 14px color: #4c4c4c text-decoration: none + cursor: pointer &:hover text-decoration: none @include vertical-gradient(#f0f0fa, #eeeef6) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1a98874c306..542f3aa0985 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -833,8 +833,8 @@ instance.web.UserMenu = instance.web.Widget.extend({ title: _t("Preferences"), width: '700px', buttons: [ - {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, {text: _t("Change password"), click: function(){ self.change_password(); }}, + {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, {text: _t("Save"), click: function(){ var inner_viewmanager = action_manager.inner_viewmanager; inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 53038ff1e11..5f24822c13b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1676,6 +1676,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(/** @lends * @param node */ init: function(field_manager, node) { + this._super(field_manager, node); this.field_manager = field_manager; this.name = this.node.attrs.name; @@ -1700,6 +1701,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(/** @lends }); }, start: function() { + var self = this; this._super.apply(this, arguments); if (this.field.translate) { this.$element.addClass('oe_form_field_translatable'); @@ -1712,10 +1714,10 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(/** @lends } if (!this.disable_utility_classes) { var set_required = function() { - this.$element.toggleClass('oe_form_required', this.get("required")); + self.$element.toggleClass('oe_form_required', self.get("required")); }; this.on("change:required", this, set_required); - _.bind(set_required, this)(); + set_required(); } }, set_value: function(value_) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 6fbbadf7adb..03d616c8886 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -307,7 +307,7 @@ t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''" t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''"> - +
    @@ -324,7 +324,7 @@ @@ -425,20 +425,20 @@
    -
    +
    -
    +
    -
    +
    From 4ee3f42e0ef39cd0bc37c13d850d9bce8dc21ba4 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 30 Apr 2012 01:09:26 +0200 Subject: [PATCH 12/51] menu trigger leaf and cleanups bzr revid: al@openerp.com-20120429230926-n0y087us3xgleguq --- addons/web/static/src/js/chrome.js | 107 +++++++++++++++-------------- 1 file changed, 55 insertions(+), 52 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 542f3aa0985..fde173df9ae 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -544,34 +544,33 @@ instance.web.Menu = instance.web.Widget.extend({ this._super.apply(this, arguments); this.has_been_loaded = $.Deferred(); this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo + this.data = {data:{children:[]}}; }, start: function() { this._super.apply(this, arguments); this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); - this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); - $('html').bind('click', this.do_hide_more); + return this.do_reload(); }, do_reload: function() { - var self = this; - return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () { - if (self.current_menu) { - self.open_menu(self.current_menu); - } - }); + return this.rpc("/web/menu/load", {}).then(this.on_loaded); }, on_loaded: function(data) { var self = this; this.data = data; this.renderElement(); this.limit_entries(); - this.$element.on('click', 'a[data-menu]', this.on_menu_click); + this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); this.$element.on('click', 'a.oe_menu_more_link', function() { self.$element.find('.oe_menu_more').toggle(); return false; }); - this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); + this.$element.on('click', 'a[data-menu]', this.on_menu_click); + this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); // Hide second level submenus this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); + if (self.current_menu) { + self.open_menu(self.current_menu); + } this.has_been_loaded.resolve(); }, limit_entries: function() { @@ -585,6 +584,7 @@ instance.web.Menu = instance.web.Widget.extend({ $index.after($more); $more.find('.oe_menu_more').append($index.next().nextAll()); } + this.do_hide_more(); }, auto_limit_entries: function() { // TODO: auto detect overflow and bind window on resize @@ -603,6 +603,7 @@ instance.web.Menu = instance.web.Widget.extend({ open_menu: function (id) { var $clicked_menu, $sub_menu, $main_menu; $clicked_menu = this.$element.add(this.$secondary_menus).find('a[data-menu=' + id + ']'); + this.trigger('open_menu', id, $clicked_menu); if (this.$secondary_menus.has($clicked_menu).length) { $sub_menu = $clicked_menu.parents('.oe_secondary_menu'); @@ -631,56 +632,58 @@ instance.web.Menu = instance.web.Widget.extend({ } } }, + /** + * Call open_menu with the first menu_item matching an action_id + * + * @param {Number} id the action_id to match + */ open_action: function (id) { var menu_id, $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']'); if (menu_id = $menu.data('menu')) { this.open_menu(menu_id); } }, - on_menu_click: function(ev, id) { - // TODO If first level menu doesnt have action trigger first leaf - this.do_hide_more(); - id = id || 0; - var $clicked_menu, manual = false; - + /** + * Process a click on a menu item + * + * @param {Number} id the menu_id + */ + menu_click: function(id) { if (id) { - // We can manually activate a menu with it's id (for hash url mapping) - manual = true; - $clicked_menu = this.$element.find('a[data-menu=' + id + ']'); - if (!$clicked_menu.length) { - $clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']'); + this.do_hide_more(); + // find back the menuitem in dom to get the action + var $item = this.$element.find('a[data-menu=' + id + ']'); + if (!$item.length) { + $item = this.$secondary_menus.find('a[data-menu=' + id + ']'); + } + var action_id = $item.data('action-id'); + // If first level menu doesnt have action trigger first leaf + if (!action_id) { + if(this.$element.has($item)) { + $sub_menu = this.$secondary_menus.find('.oe_secondary_menu[data-menu-parent=' + id + ']'); + $items = $sub_menu.find('a[data-action-id]').filter('[data-action-id!=""]'); + if($items) { + action_id = $items.data('action-id'); + id = $items.data('menu'); + } + } } - } else { - $clicked_menu = $(ev.currentTarget); - id = $clicked_menu.data('menu'); - } - - this.trigger('menuClicked', id, $clicked_menu); - - if (id) { this.open_menu(id); this.current_menu = id; this.session.active_id = id; - var action_id = $clicked_menu.data('action-id'); - if (action_id) { - this.on_action(action_id); - } - } - if (ev) { - ev.stopPropagation(); + this.trigger('menu_click', action_id, id, $item); } + }, + /** + * Jquery event handler for menu click + * + * @param {Event} ev the jquery event + */ + on_menu_click: function(ev) { + this.menu_click($(ev.currentTarget).data('menu')); + ev.stopPropagation(); return false; }, - do_show_secondary: function($sub_menu, $main_menu) { - var self = this; - this.$secondary_menus.show(); - if (!arguments.length) { - return; - } - $sub_menu.show(); - }, - on_action: function(action) { - } }); instance.web.UserMenu = instance.web.Widget.extend({ @@ -900,8 +903,6 @@ instance.web.WebClient = instance.web.Widget.extend({ this.session.on_session_valid.add(function() { self.show_application(); - self.user_menu.do_update(); - self.menu.do_reload(); if(self.action_manager) self.action_manager.destroy(); self.action_manager = new instance.web.ActionManager(self); @@ -932,11 +933,12 @@ instance.web.WebClient = instance.web.Widget.extend({ self.$element.append(self.$table); self.menu = new instance.web.Menu(self); self.menu.replace(this.$element.find('.oe_menu_placeholder')); - self.menu.on_action.add(this.proxy('on_menu_action')); + self.menu.on('menu_click', this, this.on_menu_action); self.user_menu = new instance.web.UserMenu(self); self.user_menu.replace(this.$element.find('.oe_user_menu_placeholder')); self.user_menu.on_menu_logout.add(this.proxy('on_logout')); self.user_menu.on_action.add(this.proxy('on_menu_action')); + self.user_menu.do_update(); }, show_common: function() { var self = this; @@ -997,8 +999,9 @@ instance.web.WebClient = instance.web.Widget.extend({ } else { self.menu.has_been_loaded.then(function() { var first_menu_id = self.menu.$element.find("a:first").data("menu"); - if(first_menu_id) - self.menu.on_menu_click(null,first_menu_id); + if(first_menu_id) { + self.menu.menu_click(first_menu_id); + } }); } }, @@ -1022,7 +1025,7 @@ instance.web.WebClient = instance.web.Widget.extend({ // TODO replace by client action menuclick if(action.menu_id) { this.do_reload().then(function () { - self.menu.on_menu_click(null, action.menu_id); + self.menu.menu_click(action.menu_id); }); } }, From c276326790fc56f38f22c4c34624891147501ab9 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 30 Apr 2012 01:14:26 +0200 Subject: [PATCH 13/51] fix debug select bzr revid: al@openerp.com-20120429231426-7racofk3thluhe6a --- addons/web/static/src/xml/base.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 03d616c8886..7c99777ec1a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -459,7 +459,7 @@ - +
    '); } - if (this.options.isClarkGable) { - cells.push(''); - } _(this.columns).each(function(column) { if (column.invisible === '1') { return; @@ -1322,9 +1313,6 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we if (self.options.selectable) { $row.append(''); } - if (self.options.isClarkGable) { - $row.append(''); - } _(self.columns).chain() .filter(function (column) {return !column.invisible;}) .each(function (column) { diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 816143afa5d..e539d17e63f 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -398,8 +398,6 @@ openerp.web.list_editable = function (instance) { if (this.view.editable_list.options.selectable) $("").appendTo($element); - if (this.view.editable_list.options.isClarkGable) - $("").appendTo($element); $xml.children().each(function(i, el) { var modifiers = JSON.parse($(el).attr("modifiers") || "{}"); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7c99777ec1a..76d75d60a43 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -619,7 +619,7 @@
    - + - @@ -695,9 +693,6 @@ -
    @@ -637,7 +637,6 @@ @@ -650,7 +649,6 @@
    - - - Date: Mon, 30 Apr 2012 16:35:11 +0200 Subject: [PATCH 16/51] [FIX] Fix listview's number alignment bzr revid: fme@openerp.com-20120430143511-mit8du3nw08zddmw --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 2 ++ 2 files changed, 5 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 26f77c739d4..272f575cc0b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1755,6 +1755,9 @@ .openerp .oe-listview-content td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content th.oe_list_checkbox:first-child:after { border-width: 0; } +.openerp .oe-listview-content td.oe-number { + text-align: right !important; +} .openerp .oe-listview-content .numeric { text-align: right; width: 82px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index e9890bcc922..254c528a4e9 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1457,6 +1457,8 @@ $colour4: #8a89ba width: 17px &:after border-width: 0 + td.oe-number + text-align: right !important .numeric text-align: right width: 82px From 476da193cc1c13a646055c5c357b797becc0d17a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 30 Apr 2012 18:54:55 +0200 Subject: [PATCH 17/51] [IMP] Hide leftbar if main menu has no submenus bzr revid: fme@openerp.com-20120430165455-5yh4gp775ml9spca --- addons/web/static/src/js/chrome.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 5b47434a3ce..39cdee908a4 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -621,6 +621,9 @@ instance.web.Menu = instance.web.Widget.extend({ this.$secondary_menus.find('.oe_secondary_menu').hide(); $sub_menu.show(); + // Hide/Show the leftbar menu depending of the presence of sub-items + this.$secondary_menus.parent('.oe_leftbar').toggle(!!$sub_menu.children().length); + // Activate current menu item and show parents this.$secondary_menus.find('.oe_active').removeClass('oe_active'); if ($main_menu !== $clicked_menu) { From b5e98c044948909094ec8212f902cf6a21640d5a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 30 Apr 2012 23:28:08 +0200 Subject: [PATCH 18/51] [IMP] Improve calendar view layout and styling. Still have problem with minical overflow bzr revid: fme@openerp.com-20120430212808-jjl7fmoddjd8pyo5 --- .../static/src/css/web_calendar.css | 17 ++++++- addons/web_calendar/static/src/js/calendar.js | 19 +++----- .../static/src/xml/web_calendar.xml | 45 ++++++++++--------- 3 files changed, 46 insertions(+), 35 deletions(-) diff --git a/addons/web_calendar/static/src/css/web_calendar.css b/addons/web_calendar/static/src/css/web_calendar.css index 313db123bb5..18eec963866 100644 --- a/addons/web_calendar/static/src/css/web_calendar.css +++ b/addons/web_calendar/static/src/css/web_calendar.css @@ -1,5 +1,20 @@ -#openerp_scheduler { +.oe_calendar_table { + border-top: 3px solid #eee; +} +.oe_calendar { background-color:#eee; + height: 600px; + border-right: 1px solid #eee; +} +.oe_calendar_sidebar { + width: 200px; +} +.oe_calendar_mini { + background-color: #eee; + padding: 5px; +} +.oe_calendar_filter { + padding: 0 10px; } .openerp .dhx_mini_calendar { -moz-box-shadow: none; diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 959768d895e..4d738e55514 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -8,6 +8,7 @@ var _t = instance.web._t, var QWeb = instance.web.qweb; instance.web.views.add('calendar', 'instance.web_calendar.CalendarView'); instance.web_calendar.CalendarView = instance.web.View.extend({ + template: "CalendarView", display_name: _lt('Calendar'), // Dhtmlx scheduler ? init: function(parent, dataset, view_id, options) { @@ -98,13 +99,12 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ for (var fld = 0; fld < this.fields_view.arch.children.length; fld++) { this.info_fields.push(this.fields_view.arch.children[fld].attrs.name); } - this.$element.html(QWeb.render("CalendarView", {"fields_view": this.fields_view})); this.init_scheduler(); - if (! this.sidebar && this.options.$sidebar) { + if (!this.sidebar && this.options.$sidebar) { this.sidebar = new instance.web_calendar.Sidebar(this); - this.has_been_loaded.pipe(this.sidebar.appendTo(this.options.$sidebar)); + this.has_been_loaded.pipe(this.sidebar.appendTo(this.$element.find('.oe_calendar_sidebar_container'))); } return this.has_been_loaded.resolve(); @@ -127,7 +127,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ scheduler.config.mark_now = true; scheduler.config.day_date = '%l %j'; - scheduler.init('openerp_scheduler', null, this.mode || 'month'); + scheduler.init(this.$element.find('.oe_calendar')[0], null, this.mode || 'month'); // Remove hard coded style attributes from dhtmlx scheduler this.$element.find(".dhx_cal_navline div").removeAttr('style'); @@ -143,7 +143,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.refresh_scheduler(); }, on_view_changed: function(mode, date) { - this.$element.removeClass('oe_cal_day oe_cal_week oe_cal_month').addClass('oe_cal_' + mode); + this.$element.find('.oe_calendar').removeClass('oe_cal_day oe_cal_week oe_cal_month').addClass('oe_cal_' + mode); if (!date.between(this.range_start, this.range_stop)) { this.update_range_dates(date); this.do_ranged_search(); @@ -392,18 +392,9 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ var self = this; $.when(this.has_been_loaded).then(function() { self.$element.show(); - if (self.sidebar) { - self.sidebar.$element.show(); - } self.do_push_state({}); }); }, - do_hide: function() { - this._super(); - if (this.sidebar) { - this.sidebar.$element.hide(); - } - }, get_selected_ids: function() { // no way to select a record anyway return []; diff --git a/addons/web_calendar/static/src/xml/web_calendar.xml b/addons/web_calendar/static/src/xml/web_calendar.xml index 422c37dcf0a..ee9175f06ed 100644 --- a/addons/web_calendar/static/src/xml/web_calendar.xml +++ b/addons/web_calendar/static/src/xml/web_calendar.xml @@ -1,27 +1,32 @@