Merge lp:~openerp-dev/openerp-web/trunk-customizetooltips-mba into lp:openerp-web

Proposed by Mahendra Barad(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/trunk-customizetooltips-mba
Merge into: lp:openerp-web
Diff against target: 166 lines (+49/-20)
4 files modified
addons/web/static/src/css/base.css (+3/-3)
addons/web/static/src/css/base.sass (+10/-11)
addons/web/static/src/js/view_form.js (+28/-0)
addons/web_kanban/static/src/js/kanban.js (+8/-6)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-customizetooltips-mba
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+218941@code.launchpad.net

Description of the change

Hello,
[ADD]tooltip on kanban header and on priority and kanbanselection widget.
Thanks

To post a comment you must log in.
4015. By Mahendra Barad(OpenERP)

[IMP]css for dialog wizard

4016. By Mahendra Barad(OpenERP)

[IMP]add Button label as field and set min-width for the kanban-header tooltip

4017. By Mahendra Barad(OpenERP)

[IMP]tooltip view on header

4018. By Mahendra Barad(OpenERP)

[Merge]with trunk

Unmerged revisions

4018. By Mahendra Barad(OpenERP)

[Merge]with trunk

4017. By Mahendra Barad(OpenERP)

[IMP]tooltip view on header

4016. By Mahendra Barad(OpenERP)

[IMP]add Button label as field and set min-width for the kanban-header tooltip

4015. By Mahendra Barad(OpenERP)

[IMP]css for dialog wizard

4014. By Mahendra Barad(OpenERP)

[IMP]fetch tooltip from stage model and display on widget field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css 2014-05-08 15:25:16 +0000
+++ addons/web/static/src/css/base.css 2014-05-15 05:02:21 +0000
@@ -421,17 +421,17 @@
421.openerp .oe_button.oe_link span:hover {421.openerp .oe_button.oe_link span:hover {
422 text-decoration: underline;422 text-decoration: underline;
423}423}
424.openerp .oe_webclient .oe_star_on, .openerp .oe_webclient .oe_star_off {424.openerp .oe_star_on, .openerp .oe_star_off {
425 color: #cccccc;425 color: #cccccc;
426 text-shadow: 0 0 2px black;426 text-shadow: 0 0 2px black;
427 vertical-align: top;427 vertical-align: top;
428 position: relative;428 position: relative;
429 top: -8px;429 top: -8px;
430}430}
431.openerp .oe_webclient .oe_star_on:hover, .openerp .oe_webclient .oe_star_off:hover {431.openerp .oe_star_on:hover, .openerp .oe_star_off:hover {
432 text-decoration: none;432 text-decoration: none;
433}433}
434.openerp .oe_webclient .oe_star_on {434.openerp .oe_star_on {
435 color: gold;435 color: gold;
436}436}
437.openerp p.oe_grey {437.openerp p.oe_grey {
438438
=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass 2014-05-08 15:25:16 +0000
+++ addons/web/static/src/css/base.sass 2014-05-15 05:02:21 +0000
@@ -398,17 +398,16 @@
398 font-weight: bold398 font-weight: bold
399 &:hover399 &:hover
400 text-decoration: underline400 text-decoration: underline
401 .oe_webclient401 .oe_star_on, .oe_star_off
402 .oe_star_on, .oe_star_off402 color: #cccccc
403 color: #cccccc403 text-shadow: 0 0 2px black
404 text-shadow: 0 0 2px black404 vertical-align: top
405 vertical-align: top405 position: relative
406 position: relative406 top: -8px
407 top: -8px407 .oe_star_on:hover, .oe_star_off:hover
408 .oe_star_on:hover, .oe_star_off:hover408 text-decoration: none
409 text-decoration: none409 .oe_star_on
410 .oe_star_on410 color: gold
411 color: gold
412 p.oe_grey411 p.oe_grey
413 max-width: 650px412 max-width: 650px
414 .oe_grey413 .oe_grey
415414
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2014-05-08 15:34:18 +0000
+++ addons/web/static/src/js/view_form.js 2014-05-15 05:02:21 +0000
@@ -2392,6 +2392,17 @@
2392 this.states = self.prepare_dropdown_selection();;2392 this.states = self.prepare_dropdown_selection();;
2393 this.$el.html(QWeb.render("KanbanSelection", {'widget': self}));2393 this.$el.html(QWeb.render("KanbanSelection", {'widget': self}));
2394 this.$el.find('.oe_legend').click(self.do_action.bind(self));2394 this.$el.find('.oe_legend').click(self.do_action.bind(self));
2395
2396 if (self.view.datarecord.stage_id) {
2397 var stage_id = _.isArray(self.view.datarecord.stage_id) ? self.view.datarecord.stage_id[0] : self.view.datarecord.stage_id
2398 return (new openerp.web.Model(self.view.fields.stage_id.field.relation)).query([])
2399 .filter([["id", "=", stage_id]]).first().then(function(res) {
2400 var title = res['legend_'+self.get('value')]
2401 if (title) {
2402 self.$(".oe_kanban_status").attr("title", title)
2403 }
2404 });
2405 }
2395 },2406 },
2396 do_action: function(e) {2407 do_action: function(e) {
2397 var self = this;2408 var self = this;
@@ -2442,6 +2453,20 @@
2442 this.priorities = self.prepare_priority();2453 this.priorities = self.prepare_priority();
2443 this.$el.html(QWeb.render("Priority", {'widget': this}));2454 this.$el.html(QWeb.render("Priority", {'widget': this}));
2444 this.$el.find('.oe_legend').click(self.do_action.bind(self));2455 this.$el.find('.oe_legend').click(self.do_action.bind(self));
2456
2457 if (self.view.datarecord.stage_id) {
2458 var stage_id = _.isArray(self.view.datarecord.stage_id) ? self.view.datarecord.stage_id[0] : self.view.datarecord.stage_id
2459 return (new openerp.web.Model(self.view.fields.stage_id.field.relation)).query([])
2460 .filter([["id", "=", stage_id]]).first().then(function(res) {
2461 var li = self.$('li');
2462 for (i=1; i<=li.length; i++){
2463 var title = res['legend_star'+i]
2464 if (title) {
2465 self.$("ul").find("[data-value='" + i + "'] a").attr("title", title);
2466 }
2467 }
2468 });
2469 }
2445 },2470 },
2446 do_action: function(e) {2471 do_action: function(e) {
2447 var self = this;2472 var self = this;
@@ -6169,6 +6194,9 @@
6169 if (! this.node.attrs.nolabel) {6194 if (! this.node.attrs.nolabel) {
6170 options.text = this.string6195 options.text = this.string
6171 }6196 }
6197 if(this.options.label_field){
6198 options.text = this.view.datarecord[this.options.label_field]
6199 }
6172 this.$el.html(QWeb.render("StatInfo", options));6200 this.$el.html(QWeb.render("StatInfo", options));
6173 },6201 },
61746202
61756203
=== modified file 'addons/web_kanban/static/src/js/kanban.js'
--- addons/web_kanban/static/src/js/kanban.js 2014-05-12 08:10:32 +0000
+++ addons/web_kanban/static/src/js/kanban.js 2014-05-15 05:02:21 +0000
@@ -646,7 +646,10 @@
646 }646 }
647 this.$el.data('widget', this);647 this.$el.data('widget', this);
648 this.$records.data('widget', this);648 this.$records.data('widget', this);
649 this.$has_been_started.resolve();649 var def_tooltip = this.fetch_tooltip();
650 $.when(def_tooltip).done(function (){
651 self.$has_been_started.resolve();
652 });
650 var add_btn = this.$el.find('.oe_kanban_add');653 var add_btn = this.$el.find('.oe_kanban_add');
651 add_btn.tooltip({delay: { show: 500, hide:1000 }});654 add_btn.tooltip({delay: { show: 500, hide:1000 }});
652 this.$records.find(".oe_kanban_column_cards").click(function (ev) {655 this.$records.find(".oe_kanban_column_cards").click(function (ev) {
@@ -657,8 +660,6 @@
657 }660 }
658 });661 });
659 this.is_started = true;662 this.is_started = true;
660 var def_tooltip = this.fetch_tooltip();
661 return $.when(def_tooltip);
662 },663 },
663 fetch_tooltip: function() {664 fetch_tooltip: function() {
664 if (! this.group)665 if (! this.group)
@@ -688,7 +689,7 @@
688 return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])689 return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])
689 .filter([["id", "=", this.value]]).first().then(function(res) {690 .filter([["id", "=", this.value]]).first().then(function(res) {
690 self.tooltip = res[options.tooltip_on_group_by];691 self.tooltip = res[options.tooltip_on_group_by];
691 self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tooltip();692 self.$(".oe_kanban_group_title_text").attr("title", self.tooltip.tooltip || self.title || "").tooltip();
692 });693 });
693 }694 }
694 },695 },
@@ -1272,7 +1273,7 @@
1272 var data = _.map(selection.slice(1), function(element, index) {1273 var data = _.map(selection.slice(1), function(element, index) {
1273 var value = {1274 var value = {
1274 'value': element[0],1275 'value': element[0],
1275 'name': element[1],1276 'name': self.parent.group.tooltip['legend_star'+element[0]] || element[1],
1276 'click_value': element[0],1277 'click_value': element[0],
1277 }1278 }
1278 if (index == 0 && self.get('value') == element[0]) {1279 if (index == 0 && self.get('value') == element[0]) {
@@ -1310,11 +1311,12 @@
1310 this.parent = parent;1311 this.parent = parent;
1311 },1312 },
1312 prepare_dropdown_selection: function() {1313 prepare_dropdown_selection: function() {
1314 var self = this;
1313 var data = [];1315 var data = [];
1314 _.map(this.field.selection || [], function(res) {1316 _.map(this.field.selection || [], function(res) {
1315 var value = {1317 var value = {
1316 'name': res[0],1318 'name': res[0],
1317 'tooltip': res[1],1319 'tooltip': self.parent.group.tooltip['legend_'+res[0]] || res[1],
1318 'state_name': res[1],1320 'state_name': res[1],
1319 }1321 }
1320 if (res[0] == 'normal') { value['state_class'] = 'oe_kanban_status'; }1322 if (res[0] == 'normal') { value['state_class'] = 'oe_kanban_status'; }