diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 41f1331ef6f..e9b2b8ebd79 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -9,35 +9,19 @@ background: white; } -.openerp div.oe_mail_wall_act { +.openerp div.oe_mail_wall_action { padding: 8px; background: #eee; border: 1px solid #ccc; } -.openerp div.oe_mail_wall_act:after { +.openerp div.oe_mail_wall_action:after { content: ""; display: block; clear: both; } -/* 2 columns view */ -.openerp div.oe_mail_wall_left { - float: left; - width: 560px; - margin: 8px; -} - -.openerp div.oe_mail_wall_right { - margin-left: 565px; - margin: 8px; -} - -.openerp div.oe_mail_wall_threads { - margin-top: 8px; -} - -.openerp textarea.oe_mail_wall_action_textarea { +.openerp .oe_mail_wall_action textarea { width: 474px; height: 60px; padding: 4px; @@ -45,11 +29,31 @@ float: right; } -.openerp div.oe_mail_wall_threads textarea { +/* 2 columns view */ +.openerp div.oe_mail_wall_main { + float: left; + width: 560px; + margin: 8px; +} + +.openerp div.oe_mail_wall_aside { + margin-left: 565px; + margin: 8px; +} + +/* Threads */ +.openerp .oe_mail_wall_threads { + margin-top: 8px; +} +.openerp .oe_mail_wall_threads textarea { height: 40px; padding: 4px; } +.openerp .oe_mail_wall_thread:first .oe_mail_msg_notification { + border-top: 0; +} + .openerp div.oe_mail_thread_subthread img { width: 28px; height: 28px; @@ -149,14 +153,14 @@ /* ThreadDisplay */ /* ------------------------------ */ -.openerp div.oe_mail_thread_act { +.openerp div.oe_mail_thread_action { white-space: normal; padding: 8px; background: #eee; - border-top: 1px solid #ccc + border-top: 1px solid #ccc; } -.openerp div.oe_mail_thread_act:after { +.openerp div.oe_mail_thread_action:after { content: ""; display: block; clear: both; @@ -191,13 +195,22 @@ clear: both; } -.openerp .oe_mail_msg_notification, .openerp .oe_mail_msg_comment, .openerp .oe_mail_msg_email { +.openerp .oe_mail_msg_notification, +.openerp .oe_mail_msg_comment, +.openerp .oe_mail_msg_email { padding: 8px; } -.openerp .oe_mail_msg_comment, .openerp .oe_mail_msg_email, .openerp .oe_mail_msg_notification { +.openerp .oe_mail_msg_comment, +.openerp .oe_mail_msg_email, +.openerp .oe_mail_msg_notification { background: white; - border-top: 1px solid #ccc + border-top: 1px solid #ccc; +} +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_comment, +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_email, +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_notification { + border-top: 0; } .openerp .oe_email_icon { @@ -209,7 +222,9 @@ background: #eee; } -.openerp .oe_mail_msg_notification:after, .openerp .oe_mail_msg_comment:after, .openerp .oe_mail_msg_email:after { +.openerp .oe_mail_msg_notification:after, +.openerp .oe_mail_msg_comment:after, +.openerp .oe_mail_msg_email:after { content: ""; display: block; clear: both; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9b209c137a2..7339af7c612 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -72,7 +72,7 @@ openerp.mail = function(session) { * either it will fetch [limit] messages related to [res_model]:[res_id]. */ mail.Thread = session.web.Widget.extend({ - template: 'Thread', + template: 'mail.Thread', /** * @param {Object} parent parent @@ -122,7 +122,7 @@ openerp.mail = function(session) { this._super.apply(this, arguments); // customize display if (! this.display.show_post_comment) { - this.$element.find('div.oe_mail_thread_act').hide(); + this.$element.find('div.oe_mail_thread_action').hide(); } // add events this.add_events(); @@ -171,7 +171,7 @@ openerp.mail = function(session) { }); // event: click on 'reply' in msg this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply', 'click', function (event) { - var act_dom = $(this).parents('div.oe_mail_thread_display').find('div.oe_mail_thread_act:first'); + var act_dom = $(this).parents('div.oe_mail_thread_display').find('div.oe_mail_thread_action:first'); act_dom.toggle(); event.preventDefault(); }); @@ -184,7 +184,7 @@ openerp.mail = function(session) { var call_defer = self.ds_msg.unlink([parseInt(msg_id)]); $(event.srcElement).parents('.oe_mail_thread_msg').eq(0).hide(); if (self.params.thread_level > 0) { - $(event.srcElement).parents('ul.oe_mail_thread').eq(0).hide(); + $(event.srcElement).parents('.oe_mail_thread').eq(0).hide(); } return false; }); @@ -539,7 +539,7 @@ openerp.mail = function(session) { /* ThreadView widget: thread of comments */ mail.RecordThread = session.web.form.AbstractField.extend({ // QWeb template to use when rendering the object - template: 'RecordThread', + template: 'mail.RecordThread', init: function() { this._super.apply(this, arguments); @@ -581,7 +581,7 @@ openerp.mail = function(session) { this._super.apply(this, arguments); var self = this; this.reinit(); - if (! this.view.datarecord.id) { this.$element.find('ul.oe_mail_thread').hide(); return; } + if (! this.view.datarecord.id) { this.$element.find('.oe_mail_thread').hide(); return; } // fetch followers var fetch_sub_done = this.fetch_subscribers(); // create and render Thread widget @@ -645,7 +645,7 @@ openerp.mail = function(session) { /* WallView widget: a wall of messages */ mail.WallView = session.web.Widget.extend({ - template: 'Wall', + template: 'mail.Wall', /** * @param {Object} parent parent @@ -695,7 +695,7 @@ openerp.mail = function(session) { add_event_handlers: function () { var self = this; // post a comment - this.$element.find('button.oe_mail_wall_button_comment').click(function () { return self.do_comment(); }); + this.$element.find('.oe_mail_wall_action button').click(function () { return self.do_comment(); }); // display more threads this.$element.find('button.oe_mail_wall_button_more').click(function () { return self.do_more(); }); }, @@ -781,7 +781,7 @@ openerp.mail = function(session) { var records = self.comments_structure.tree_struct[root_id]['for_thread_msgs']; var model_name = self.comments_structure.msgs[root_id]['model']; var res_id = self.comments_structure.msgs[root_id]['res_id']; - var render_res = session.web.qweb.render('WallThreadContainer', {}); + var render_res = session.web.qweb.render('mail.WallThreadContainer', {}); $('
  • ').html(render_res).appendTo(self.$element.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(self, { 'res_model': model_name, 'res_id': res_id, 'uid': self.session.uid, 'records': records, @@ -835,7 +835,7 @@ openerp.mail = function(session) { /** Action: Posts a comment */ do_comment: function () { - var comment_node = this.$element.find('textarea.oe_mail_wall_action_textarea'); + var comment_node = this.$element.find('.oe_mail_wall_action textarea'); var body_text = comment_node.val(); comment_node.val(''); var call_done = this.ds_users.call('message_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment', 'html']).then(this.proxy('init_and_fetch_comments')); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index a5d669a4f00..7f74f3f5d80 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -1,15 +1,15 @@