diff --git a/addons/gamification/goal_view.xml b/addons/gamification/goal_view.xml
index 9d2084349e6..7f3cdd764c6 100644
--- a/addons/gamification/goal_view.xml
+++ b/addons/gamification/goal_view.xml
@@ -46,7 +46,7 @@
-
+
diff --git a/addons/gamification/static/src/css/goal.css b/addons/gamification/static/src/css/goal.css
index 443455a20a7..e6bc4acf14c 100644
--- a/addons/gamification/static/src/css/goal.css
+++ b/addons/gamification/static/src/css/goal.css
@@ -25,7 +25,7 @@
-moz-column-count: 3;
}*/
-.openerp .oe_mail_wall .oe_user_sidebar {
+.openerp .oe_mail_wall .oe_mail_wall_aside {
margin-left: 20px;
margin-top: 20px;
position: relative;
@@ -33,40 +33,40 @@
vertical-align: top;
width: 250px;
}
-.openerp .oe_user_sidebar .oe_gamification_goal {
+.openerp .oe_mail_wall_aside .oe_gamification_goal {
background: #EDEDF6;
height: auto;
padding: 15px;
border: solid 1px rgba(0,0,0,0.03);
}
-.openerp .oe_user_sidebar .oe_gamification_goal .oe_goal_reached:before {
+.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_reached:before {
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QMSCREbCamR5gAAAXhJREFUOMuV0z9rlEEQBvDf7htFFIwQBCvRQuFAJSJooY29VrH0E1hcCqNign8SYzAxRfTA0nyAg3wBK1GCKSwTK8G7j6AgiHl3LbLmwOQu8Wl2mZ15Zp6ZnWC/GMcrjBvBdTRkX4P/QdNZrGKkWN7sn+CuE5IvsqOyKFnRMhb3DJwsZ2VV5ZgoCt5qGdsyD8ITzGJSW3BVkAUdlZsu++0T/SU8xxQeuyj7LKEWJKcs6Px16y9harv0NVEQBZWmBR33e26Dm/hMW3BLLUvW/XJBlM31XIZMlNsi7pWa5jGjIbiBXBLd8UL+N0e0WIInvMNp8+Wltqx2SBJk06Z98HRnkUHTOZWPomEVojOiUZV26foP2XkHdD3aSRBxXDIsSRKyddmyGklQa5vRtbl7myprvrnisOBa0TuEgyBhziXwfneCrTG+9kDSkgQJSbaJ2ix42H9QYXvTakdEG4KThfanoKHS9XIvgt7KjspW8F2wIbhtSRr0Vf4AD6Nod0TaN4kAAAAASUVORK5CYII=);
margin-left:-40px;
}
-.openerp .oe_user_sidebar .oe_gamification_goal .oe_goal_failed:before {
+.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_failed:before {
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QMVECkXmaDBcAAAAUxJREFUKM+N0jFrVEEUhuFnV1KICS7ExcLCSgiCYJXCxt5C8B+ohYVgYeUfMJBCUIydkCpRLG3EThSxU0ypxMZKYQkSzd7cO3dmLJxNNhckGTgMfHPe+c6ZOZ7Sb7gauOIIq+V2wwVjFjNtYhS4dgh0L1EnvhtzKbGdyQW+8R/ofmJc8r64Ra/hYuJHEbda7nSgB1PQRsVpc2j+xfnEZjncjtz9zLHIw0SdyZH3uwx/wmDq5oaFyKeJc2QzsVOgVzXDveRBp5fAucjbTJ5E5EWYhtDvPkJiC1878rdEdUAZHHQ7FVkrpdaJ35lQXJ8EZveST5a9Zr7lZYFS5HHF2cjztF/ys11OgDP0auYjbwrURFZGzMAvjkfW077z6z/MGjGMfCxQFXnU7fsdvcjq5FsSH1RcnkAty4eM3EqiyTTW6AeuB5aOOOTLgZt/AfLdvLh74DfrAAAAAElFTkSuQmCC);
margin-left:-40px;
}
-.openerp .oe_user_sidebar .oe_gamification_goal .oe_goal_reached,
-.openerp .oe_user_sidebar .oe_gamification_goal .oe_goal_failed {
+.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_reached,
+.openerp .oe_mail_wall_aside .oe_gamification_goal .oe_goal_failed {
text-decoration: line-through;
padding-left: 20px;
}
-.openerp .oe_mail_wall .oe_user_sidebar ul {
+.openerp .oe_mail_wall .oe_mail_wall_aside ul {
list-style-type: none;
padding-left: 20px;
margin-bottom: 10px;
}
-.openerp .oe_mail_wall .oe_user_sidebar li {
+.openerp .oe_mail_wall .oe_mail_wall_aside li {
margin-bottom: 10px;
}
-.openerp .oe_mail_wall .oe_user_sidebar li progress {
+.openerp .oe_mail_wall .oe_mail_wall_aside li progress {
width: 80%;
display: inline-block;
}
-.openerp .oe_mail_wall .oe_user_sidebar li p {
+.openerp .oe_mail_wall .oe_mail_wall_aside li p {
margin:5px 0;
}
.openerp .oe_mail_wall .oe_mail {
diff --git a/addons/gamification/static/src/js/gamification.js b/addons/gamification/static/src/js/gamification.js
index 667f856059e..5b503171337 100644
--- a/addons/gamification/static/src/js/gamification.js
+++ b/addons/gamification/static/src/js/gamification.js
@@ -1,7 +1,9 @@
openerp.gamification = function(instance) {
console.log("Debug statement: file loaded");
+ var QWeb = instance.web.qweb;
- instance.Side_bar = instance.mail.Widget.include( {
+ instance.gamification.Sidebar = instance.web.Widget.extend({
+ template: 'gamification.user_wall_sidebar',
init: function (parent, action) {
var self = this;
this._super(parent, action);
@@ -12,8 +14,7 @@ openerp.gamification = function(instance) {
events: {
'click a.oe_update_goal': function(event) {
var self = this;
- var goal_id = parseInt(event.target.id);
- console.log(goal_id);
+ var goal_id = parseInt(event.currentTarget.id);
var goal_updated = new instance.web.Model('gamification.goal').call('update', [[goal_id]]);
$.when(goal_updated).done(function() {
self.get_goal_todo_info();
@@ -23,37 +24,46 @@ openerp.gamification = function(instance) {
renderElement: function() {
var self = this;
this._super.apply(this, arguments);
- self.render_template(self.$el.filter(".oe_user_sidebar"),'user_wall');
self.get_goal_todo_info();
},
render_template: function(target,template) {
var self = this;
- target.append(instance.web.qweb.render(template,{'widget': self}));
+ target.append(QWeb.render(template,{'widget': self}));
},
render_template_replace: function(target,template) {
var self = this;
- target.html(instance.web.qweb.render(template,{'widget': self}));
+ target.html(QWeb.render(template,{'widget': self}));
},
get_goal_todo_info: function() {
var self = this;
- console.log(this);
var goals_info = this.res_user.call('get_goals_todo_info', {}).then(function(res) {
self.goals_info['info'] = res
});
$.when(goals_info).done(function() {
console.log(self.goals_info.info);
if(self.goals_info.info.length > 0){
- self.render_template_replace(self.$el.find(".oe_gamification_goal"),'goal_list_to_do');
+ self.render_template_replace(self.$el.filter(".oe_gamification_goal"),'gamification.goal_list_to_do');
}
});
},
update_goal: function() {
- console.log(this);
- console.log(instance.Side_bar);
var goal_update = new instance.web.Model('gamification.goal').call('update', [[parseInt(this.id)]]);
$.when(goal_update).done(function() {
- // $(".oe_user_sidebar").find(".oe_gamification_goal").html(instance.web.qweb.render('goal_list_to_do'));
+ $(".oe_user_sidebar").find(".oe_gamification_goal").html(QWeb.render('gamification.goal_list_to_do'));
});
},
});
+
+ instance.mail.Widget.include({
+ init: function (parent, action) {
+ var self = this;
+ this._super(parent, action);
+ },
+ start: function() {
+ this._super();
+ var self = this;
+ var sidebar = new instance.gamification.Sidebar(self);
+ sidebar.appendTo($('.oe_mail_wall_aside'));
+ }
+ });
};
diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml
index c47e5896a83..5ce77e9835c 100644
--- a/addons/gamification/static/src/xml/gamification.xml
+++ b/addons/gamification/static/src/xml/gamification.xml
@@ -1,14 +1,8 @@
-
-
-
-
-
-
-
-
+
+
-
+
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index b26ef06f5e4..6497917f113 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -195,6 +195,7 @@
+