Merge lp:~openerp-dev/openerp-web/7.0-kanban-size-chm into lp:openerp-web/7.0

Proposed by Christophe Matthieu (OpenERP)
Status: Rejected
Rejected by: Antony Lesuisse (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/7.0-kanban-size-chm
Merge into: lp:openerp-web/7.0
Diff against target: 103 lines (+34/-2)
3 files modified
addons/web_kanban/static/src/css/kanban.css (+0/-1)
addons/web_kanban/static/src/css/kanban.sass (+0/-1)
addons/web_kanban/static/src/js/kanban.js (+34/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-kanban-size-chm
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+141761@code.launchpad.net
To post a comment you must log in.
3681. By Nicolas Vanhoren (OpenERP)

[FIX] css problem in list view: list arrow appearing when we sort could appear on the text

3682. By Fabien (Open ERP)

[IMP] kanban column width

3683. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3684. By Christophe Matthieu (OpenERP)

[FIX] py.js: add the name of value to display error when debugging.

3685. By Christophe Matthieu (OpenERP)

[MERGE] trunk-bug-1095257-vja: In IE9,create database page should display in center.

3686. By Fabien (Open ERP)

[FIX] kanban width improvement

3687. By Fabien (Open ERP)

[IMP] french translation

3688. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3689. By Fabien Meghazi (OpenERP)

[FIX] Kanban view produce multiple result set on multiple concurrent searches

3690. By Christophe Matthieu (OpenERP)

[IMP] menu css, don't display active color and need action hover the content document

3691. By Fabien Meghazi (OpenERP)

[FIX] Empty binary fields does not hide filename placeholder

3692. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3693. By Nicolas Vanhoren (OpenERP)

[FIX] problem when multiple instances of the web client run in tabs and we disconnect from one tab, now displays a better error message

3694. By Christophe Matthieu (OpenERP)

[FIX] kanban view: css change for title elipsis

3695. By Christophe Matthieu (OpenERP)

[IMP] kanban view: auto size column

Unmerged revisions

3695. By Christophe Matthieu (OpenERP)

[IMP] kanban view: auto size column

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_kanban/static/src/css/kanban.css'
2--- addons/web_kanban/static/src/css/kanban.css 2013-01-09 09:44:51 +0000
3+++ addons/web_kanban/static/src/css/kanban.css 2013-01-09 09:51:20 +0000
4@@ -84,7 +84,6 @@
5 color: #333333;
6 text-shadow: 0 1px 0 white;
7 margin-right: 30px;
8- width: 200px;
9 }
10 .openerp .oe_kanban_view .oe_kanban_group_title .oe_kanban_group_title_text {
11 margin-right: 4px;
12
13=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
14--- addons/web_kanban/static/src/css/kanban.sass 2013-01-09 09:44:51 +0000
15+++ addons/web_kanban/static/src/css/kanban.sass 2013-01-09 09:51:20 +0000
16@@ -112,7 +112,6 @@
17 color: #333333
18 text-shadow: 0 1px 0 white
19 margin-right: 30px
20- width: 200px
21 .oe_kanban_group_title_text
22 margin-right: 4px
23 white-space: nowrap
24
25=== modified file 'addons/web_kanban/static/src/js/kanban.js'
26--- addons/web_kanban/static/src/js/kanban.js 2013-01-07 12:37:21 +0000
27+++ addons/web_kanban/static/src/js/kanban.js 2013-01-09 09:51:20 +0000
28@@ -55,6 +55,7 @@
29 self.$buttons.find('.oe_kanban_add_column').openerpBounce();
30 }
31 });
32+ this.width = this.$el.width();
33 },
34 destroy: function() {
35 this._super.apply(this, arguments);
36@@ -300,6 +301,27 @@
37 group.destroy();
38 });
39 },
40+ do_resize: function() {
41+ var self = this;
42+ var nb_unfolded = 0;
43+ var nb_folded = 0;
44+ _.each(self.groups, function (val) {
45+ if (val.group && val.group.attributes && val.group.attributes.folded) {
46+ nb_folded++;
47+ } else {
48+ nb_unfolded++;
49+ }
50+ });
51+ var width_folded = 40;
52+ var width_unfolded = Math.floor((this.width - width_folded*nb_folded)/nb_unfolded);
53+ if (width_unfolded < 200) width_unfolded = 200;
54+ else if (width_unfolded > 300) width_unfolded = 300;
55+ _.each(self.groups, function (val) {
56+ val.width_folded = width_folded ;
57+ val.width_unfolded = width_unfolded;
58+ val.do_resize();
59+ });
60+ },
61 do_add_groups: function(groups) {
62 var self = this;
63 var $parent = this.$el.parent();
64@@ -319,6 +341,7 @@
65 _.each(self.groups, function(group) {
66 group.compute_cards_auto_height();
67 });
68+ self.do_resize();
69 });
70 },
71 on_groups_started: function() {
72@@ -553,6 +576,7 @@
73 start: function() {
74 var self = this,
75 def = this._super();
76+ this.do_resize();
77 if (! self.view.group_by) {
78 self.$el.addClass("oe_kanban_no_group");
79 self.quick = new (get_class(self.view.quick_create_class))(this, self.dataset, {}, false)
80@@ -625,6 +649,12 @@
81 this.$records.remove();
82 }
83 },
84+ do_resize: function() {
85+ var $header = this.$(".oe_kanban_header");
86+ var width = this.group && this.group.attributes && this.group.attributes.folded ? this.width_folded : this.width_unfolded;
87+ width += $header.width() - this.$el.outerWidth(); // get margin
88+ $header.css("width", width);
89+ },
90 do_show_more: function(evt) {
91 var self = this;
92 var ids = self.view.dataset.ids.splice(0);
93@@ -674,6 +704,10 @@
94 },
95 do_action_toggle_fold: function() {
96 this.do_toggle_fold();
97+ this.group = this.group || {};
98+ this.group.attributes = this.group.attributes || {};
99+ this.group.attributes.folded = !this.group.attributes.folded;
100+ this.__parentedParent.do_resize();
101 },
102 do_action_edit: function() {
103 var self = this;