diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index e2aa3451f31..5ca4542b1fe 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -230,6 +230,10 @@ clear: both; } +.openerp .oe_mail_msg_content a { + cursor: pointer; +} + .openerp img.oe_mail_icon { width: 50px; height: 50px; @@ -345,31 +349,20 @@ text-decoration: none; } -.openerp .oe_mail_msg_footer { - color: #888; -} - -.openerp .oe_mail_msg_footer li { - float: left; - margin-right: 3px; -} - -.openerp .oe_mail_msg_body { +.openerp .oe_mail_msg .oe_mail_msg_body { margin-bottom: .5em; text-align: justify; } -.openerp .oe_mail_msg_record_body pre { +.openerp .oe_mail_msg .oe_mail_msg_body pre { font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; margin: 0px; -} - -.openerp .oe_mail_msg_body span.oe_mail_msg_tail { + white-space: pre-wrap; display: inline; } /* Read more/less link */ -.openerp .oe_mail_msg_content .oe_mail_reduce { +.openerp .oe_mail_msg span.oe_mail_reduce { position: absolute; right: 0; } @@ -387,11 +380,18 @@ border-top: 4px solid #404040; } -.openerp .oe_mail_msg_footer li:after { +/* Message fopoter */ +.openerp .oe_mail_msg .oe_mail_msg_footer { + color: #888; +} +.openerp .oe_mail_msg .oe_mail_msg_footer li { + float: left; + margin-right: 3px; +} +.openerp .oe_mail_msg .oe_mail_msg_footer li:after { content: " ยท "; } - -.openerp .oe_mail_msg_footer li:last-child:after { +.openerp .oe_mail_msg .oe_mail_msg_footer li:last-child:after { content: ""; } @@ -410,6 +410,3 @@ padding: 0; list-style-type: square; } -.openerp .oe_mail_msg_content a { - cursor: pointer; -} diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index ee08ff27d3d..a9d56e02cb7 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -281,6 +281,7 @@ openerp.mail = function(session) { this.ds_message = new session.web.DataSetSearch(this, 'mail.message'); // display customization vars this.display = { + show_record_name: true, truncate_limit: options.truncate_limit || 250, show_header_compose: options.show_header_compose || false, show_reply: options.show_reply || false, @@ -380,7 +381,7 @@ openerp.mail = function(session) { 'default_parent_id': this.options.default_parent_id, 'default_content_subtype': 'plain'} ); } - return this._super(action, on_close); + // return this._super(action, on_close); }, /** Instantiate the composition form, with every parameters in context @@ -486,7 +487,7 @@ openerp.mail = function(session) { // render, add the expand feature var rendered = session.web.qweb.render('mail.thread.message', {'record': record, 'thread': this, 'params': this.options, 'display': this.display}); $(rendered).appendTo(this.$el.children('div.oe_mail_thread_display:first')); - this.$el.find('div.oe_mail_msg_record_body').expander({ + this.$el.find('div.oe_mail_msg_body').expander({ slicePoint: this.options.msg_more_limit, expandText: 'read more', userCollapseText: '[^]', @@ -633,9 +634,11 @@ openerp.mail = function(session) { /** * @param {Object} parent parent * @param {Object} [options] - * @param {Number} [options.domain] domain on the Wall, is an array. - * @param {Number} [options.domain] context, is an object. It should + * @param {Array} [options.domain] domain on the Wall + * @param {Object} [options.context] context, is an object. It should * contain default_model, default_res_id, to give it to the threads. + * @param {Number} [options.thread_level] number of thread levels to display + * 0 being flat. */ init: function (parent, options) { this._super(parent); @@ -649,9 +652,9 @@ openerp.mail = function(session) { start: function () { this._super.apply(this, arguments); - var search_view_ready = this.load_search_view({}, false); - var thread_displayed = this.message_display(); - return (search_view_ready && thread_displayed); + var searchview_ready = this.load_searchview({}, false); + var thread_displayed = this.message_render(); + return (searchview_ready && thread_displayed); }, /** @@ -659,7 +662,7 @@ openerp.mail = function(session) { * @param {Object} defaults ?? * @param {Boolean} hidden some kind of trick we do not care here */ - load_search_view: function (defaults, hidden) { + load_searchview: function (defaults, hidden) { var self = this; this.searchview = new session.web.SearchView(this, this.ds_msg, false, defaults || {}, hidden || false); return this.searchview.appendTo(this.$el.find('.oe_view_manager_view_search')).then(function () { @@ -668,9 +671,8 @@ openerp.mail = function(session) { }, /** - * Aggregate the domains, contexts and groupbys in parameter - * with those from search form, and then calls fetch_comments - * to actually fetch comments + * Get the domains, contexts and groupbys in parameter from search + * view, then render the filtered threads. * @param {Array} domains * @param {Array} contexts * @param {Array} groupbys @@ -685,27 +687,26 @@ openerp.mail = function(session) { self.search_results['context'] = results.context; self.search_results['domain'] = results.domain; self.search_results['groupby'] = results.group_by; - self.message_clean(); - return self.message_display(); + return self.message_render(); }); }, - /** Clean the wall */ - message_clean: function() { + /** Cleand and display the threads */ + message_render: function () { this.$el.find('ul.oe_mail_wall_threads').empty(); - }, - - /** Display the Wall threads */ - message_display: function () { var domain = this.options.domain.concat(this.search_results['domain']); var render_res = session.web.qweb.render('mail.wall_thread_container', {}); $(render_res).appendTo(this.$el.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(this, { - 'context': this.options.context, 'domain': domain, + 'context': this.options.context, + 'domain': domain, // display options - 'thread_level': this.options.thread_level, 'composer': true, - 'show_header_compose': true, 'show_reply': this.options.thread_level > 0, - 'show_hide': true, 'show_reply_by_email': true, + 'thread_level': this.options.thread_level, + 'composer': true, + 'show_header_compose': true, + 'show_reply': this.options.thread_level > 0, + 'show_hide': true, + 'show_reply_by_email': true, } ); return thread.appendTo(this.$el.find('li.oe_mail_wall_thread:last')); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index da1ba28b849..09da919a78d 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -132,10 +132,10 @@
-
+ - -
+ +