diff options
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail.css | 10 | ||||
| -rw-r--r-- | addons/mail/static/src/js/suggestions.js | 8 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/suggestions.xml | 9 |
3 files changed, 21 insertions, 6 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index d22b58bde74..9076ae0387e 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -683,7 +683,7 @@ width: 300px; } -.openerp .oe_mail_wall_aside > div { +.openerp .oe_mail_wall_aside .oe_sidebar_suggestion { background-color: #EDEDF6; border-radius: 2px; padding: 10px; @@ -710,16 +710,18 @@ .openerp .oe_mail_wall_aside .oe_suggestion_action { margin-top: 10px; } -.openerp .oe_mail_wall_aside .oe_remove_suggested_item { +.openerp .oe_mail_wall_aside .oe_remove_suggested_item, +.openerp .oe_mail_wall_aside .oe_remove_suggestion { visibility:hidden; width:3%; float:right; margin-right:20px; } -.openerp .oe_mail_wall_aside .oe_suggested_item:hover .oe_remove_suggested_item > span { +.openerp .oe_mail_wall_aside .oe_suggested_item:hover .oe_remove_suggested_item > span, +.openerp .oe_mail_wall_aside .oe_suggestion_display:hover .oe_remove_suggestion > span { visibility: visible; } -.openerp .oe_mail_wall_aside .oe_item { +.openerp .oe_mail_wall_aside .oe_item,.oe_suggestion_display { width: 90%; } .openerp .oe_mail_wall_aside .oe_item .oe_item_name { diff --git a/addons/mail/static/src/js/suggestions.js b/addons/mail/static/src/js/suggestions.js index 137607a7643..ad0867f4930 100644 --- a/addons/mail/static/src/js/suggestions.js +++ b/addons/mail/static/src/js/suggestions.js @@ -16,6 +16,7 @@ openerp.mail.suggestions = function(session, mail) { var removed_suggested_group = session.removed_suggested_group = []; suggestions.Groups = session.web.Widget.extend({ events: { + 'click .oe_remove_suggestion_employees': "remove_employee_suggestions", 'click .oe_remove_suggested_group': "remove_suggested_group", 'click .oe_join_group': "join_group", 'click .oe_open_group': "open_group" @@ -25,6 +26,7 @@ openerp.mail.suggestions = function(session, mail) { this._super(parent, action); this.deferred = $.Deferred(); this.mail_group = new session.web.DataSetSearch(this, 'mail.group'); + this.res_users = new session.web.DataSetSearch(this, 'res.users'); this.suggestions = []; }, start: function() { @@ -70,6 +72,12 @@ openerp.mail.suggestions = function(session, mail) { var self = this; removed_suggested_group.push($(event.currentTarget).attr('id')); self.get_suggested_group(); + }, + remove_employee_suggestions: function(event) { + var self = this; + return this.res_users.call('stop_showing_group_suggestions', [this.session.uid]).then(function(res) { + self.$(".oe_sidebar_group").hide(); + }); } }); diff --git a/addons/mail/static/src/xml/suggestions.xml b/addons/mail/static/src/xml/suggestions.xml index 949e421143c..1ebd2f6276c 100644 --- a/addons/mail/static/src/xml/suggestions.xml +++ b/addons/mail/static/src/xml/suggestions.xml @@ -6,8 +6,13 @@ </t> <!-- Suggested groups --> - <div t-name="mail.suggestions.groups" class="oe_sidebar_group"> - <p class="oe_suggestion_display">Suggested Groups</p> + <div t-name="mail.suggestions.groups" class="oe_sidebar_suggestion oe_sidebar_group"> + <p class="oe_suggestion_display"> + Suggested Groups + <a class="oe_remove_suggestion oe_remove_suggestion_employees" rol="button"> + <span class="oe_kanban_action oe_kanban_action_a">X</span> + </a> + </p> <div class="oe_suggest_groups"> <t t-foreach="widget.suggestions" t-as="result"> <div class="oe_suggested_item"> |
