From b18bc579197837ddcc97d9f7292d8cec3bc05d49 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 12 Apr 2013 17:21:50 +0200 Subject: [ADD] use sparklines bzr revid: mat@openerp.com-20130412152150-8679huigt6cfmool --- addons/hr_gamification/static/src/js/badges.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 addons/hr_gamification/static/src/js/badges.js (limited to 'addons/hr_gamification/static/src') diff --git a/addons/hr_gamification/static/src/js/badges.js b/addons/hr_gamification/static/src/js/badges.js new file mode 100644 index 00000000000..7506c65f144 --- /dev/null +++ b/addons/hr_gamification/static/src/js/badges.js @@ -0,0 +1,25 @@ +openerp.hr_gamification = function(instance) { + instance.web_kanban.KanbanRecord.include({ + on_card_clicked: function() { + if (this.view.dataset.model === 'gamification.badge') { + if (this.record.stat_count.raw_value > 0) { + this.$('.oe_kanban_badge_avatars a').first().click(); + } else { + return false; + } + } else if (this.view.dataset.model === 'gamification.badge.user') { + var action = { + type: 'ir.actions.act_window', + res_model: 'gamification.badge', + view_mode: 'form', + view_type: 'form,kanban,tree', + views: [[false, 'form']], + res_id: this.record.badge_id.raw_value[0] + }; + this.do_action(action); + } else { + this._super.apply(this, arguments); + } + } + }); +}; -- cgit v1.2.3 From 0b0c24a6364c98604d1b9d06462274e87a79d0bd Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 16 Apr 2013 14:45:58 +0200 Subject: [REF] moving to only hr_gamification module bzr revid: mat@openerp.com-20130416124558-p40tkw8mgr4e7v04 --- addons/hr_gamification/static/src/js/badges.js | 25 ---------------------- .../hr_gamification/static/src/js/gamification.js | 19 ++++++++++++++++ 2 files changed, 19 insertions(+), 25 deletions(-) delete mode 100644 addons/hr_gamification/static/src/js/badges.js create mode 100644 addons/hr_gamification/static/src/js/gamification.js (limited to 'addons/hr_gamification/static/src') diff --git a/addons/hr_gamification/static/src/js/badges.js b/addons/hr_gamification/static/src/js/badges.js deleted file mode 100644 index 7506c65f144..00000000000 --- a/addons/hr_gamification/static/src/js/badges.js +++ /dev/null @@ -1,25 +0,0 @@ -openerp.hr_gamification = function(instance) { - instance.web_kanban.KanbanRecord.include({ - on_card_clicked: function() { - if (this.view.dataset.model === 'gamification.badge') { - if (this.record.stat_count.raw_value > 0) { - this.$('.oe_kanban_badge_avatars a').first().click(); - } else { - return false; - } - } else if (this.view.dataset.model === 'gamification.badge.user') { - var action = { - type: 'ir.actions.act_window', - res_model: 'gamification.badge', - view_mode: 'form', - view_type: 'form,kanban,tree', - views: [[false, 'form']], - res_id: this.record.badge_id.raw_value[0] - }; - this.do_action(action); - } else { - this._super.apply(this, arguments); - } - } - }); -}; diff --git a/addons/hr_gamification/static/src/js/gamification.js b/addons/hr_gamification/static/src/js/gamification.js new file mode 100644 index 00000000000..a9126464a10 --- /dev/null +++ b/addons/hr_gamification/static/src/js/gamification.js @@ -0,0 +1,19 @@ +openerp.hr_gamification = function(instance) { + instance.web_kanban.KanbanRecord.include({ + on_card_clicked: function() { + if (this.view.dataset.model === 'gamification.badge.user') { + var action = { + type: 'ir.actions.act_window', + res_model: 'gamification.badge', + view_mode: 'form', + view_type: 'form,kanban,tree', + views: [[false, 'form']], + res_id: this.record.badge_id.raw_value[0] + }; + this.do_action(action); + } else { + this._super.apply(this, arguments); + } + } + }); +}; -- cgit v1.2.3