diff options
| author | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-08-06 11:12:19 +0530 |
|---|---|---|
| committer | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-08-06 11:12:19 +0530 |
| commit | 2cc02f84d245871402dabfdba67dee62bdb30fa2 (patch) | |
| tree | b39f15bc7b70e89347768b3ebacf3f7e27a23984 /addons/mail/static/src | |
| parent | c494b78f7776f64bde8d4cdefa82f7cdda867548 (diff) | |
| parent | 1da7ac2448a5e29bb43994286d3fbb8d90576d54 (diff) | |
[MERGE]merge with lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa
bzr revid: sgo@tinyerp.com-20120806054219-yxe9cwx4yguz7t55
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail.css | 6 | ||||
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 17 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 21 |
3 files changed, 23 insertions, 21 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 03f1078e6d5..c0317633aa7 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -359,9 +359,9 @@ } /* Read more/less link */ -.openerp .oe_mail_msg_content .expand, -.openerp .oe_mail_msg_content .reduce { - font-weight: bold; +.openerp .oe_mail_msg_content .oe_mail_reduce { + position: absolute; + right: 0; } /* Dropdown menu */ diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index f488225d8b6..2173b4845e1 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -373,7 +373,8 @@ openerp.mail = function(session) { action_buttons: false, pager: false, initial_mode: 'edit', - }); + disable_autofocus: true, + }); // add the form, bind events, activate the form var msg_node = this.$element.find('div.oe_mail_msg_content'); return $.when(this.form_view.appendTo(msg_node)).pipe(function() { @@ -521,7 +522,7 @@ openerp.mail = function(session) { this.params.parent_id = this.params.parent_id || false; this.params.thread_level = this.params.thread_level || 0; this.params.is_wall = this.params.is_wall || (this.params.records != undefined) || false; - this.params.msg_more_limit = this.params.msg_more_limit || 150; + this.params.msg_more_limit = this.params.msg_more_limit || 250; this.params.limit = this.params.limit || 100; // this.params.limit = 3; // tmp for testing this.params.offset = this.params.offset || 0; @@ -736,7 +737,7 @@ openerp.mail = function(session) { /** Displays a record, performs text/link formatting */ display_comment: function (record) { - record.body = mail.ChatterUtils.do_text_nl2br(record.body, true); + record.body = mail.ChatterUtils.do_text_nl2br($.trim(record.body), true); // if (record.type == 'email' && record.state == 'received') { if (record.type == 'email') { record.mini_url = ('/mail/static/src/img/email_icon.png'); @@ -754,15 +755,15 @@ openerp.mail = function(session) { record.is_author = mail.ChatterUtils.is_author(this, record.user_id[0]); // render var rendered = session.web.qweb.render('mail.thread.message', {'record': record, 'thread': this, 'params': this.params, 'display': this.display}); - $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first')); // expand feature - this.$element.find('div.oe_mail_msg_body:last').expander({ + $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first')); + this.$element.find('div.oe_mail_msg_record_body').expander({ slicePoint: this.params.msg_more_limit, - expandText: 'see more', - userCollapseText: 'see less', + expandText: 'read more', + userCollapseText: '[^]', detailClass: 'oe_mail_msg_tail', moreClass: 'oe_mail_expand', - lesClass: 'oe_mail_reduce', + lessClass: 'oe_mail_reduce', }); }, diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index bf8d7fd1475..86d115f29c8 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -33,7 +33,7 @@ <!-- contains threads --> </ul> <div class="oe_mail_wall_more"> - <button class="oe_mail_wall_button_more" type="button">See more discussions</button> + <button class="oe_mail_wall_button_more" type="button">See more...</button> </div> </div> <div class="oe_mail_wall_aside"> @@ -129,7 +129,7 @@ <t t-if="display['show_delete']"> <li t-if="record.is_author"><a href="#" class="oe_mail_msg_delete" t-attf-data-id='{record.id}'>Delete</a></li> </t> - <li t-if="display['show_hide']"><a href="#" class="oe_mail_msg_hide" t-attf-data-id='{record.id}'>Remove from Wall</a></li> + <li t-if="display['show_hide']"><a href="#" class="oe_mail_msg_hide" t-attf-data-id='{record.id}'>Hide</a></li> <!-- Uncomment when adding subtype hiding <li t-if="display['show_hide']"> <a href="#" class="oe_mail_msg_hide_type" t-attf-data-subtype='{record.subtype}'>Hide '<t t-esc="record.subtype"/>' for this document</a> @@ -143,16 +143,17 @@ <h1 t-if="record.subject" class="oe_mail_msg_title"> <t t-raw="record.subject"/> </h1> - <div t-if="params.thread_level > 0" class="oe_mail_msg_subtitle"> - <a t-attf-href="#model=#{params.res_model}&id=#{params.res_id}"><t t-raw="record.record_name"/></a> - </div> - <div class="oe_clear"/> <div class="oe_mail_msg_body"> - <a t-attf-href="#model=res.users&id=#{record.user_id[0]}"><t t-raw="record.user_id[1]"/></a> - <div class="oe_mail_msg_record_body"><t t-raw="record.body"/></div> + + <div class="oe_mail_msg_record_body"> + <a t-attf-href="#model=#{params.res_model}&id=#{params.res_id}" t-if="(params.thread_level > 0) & (!record.subject)"><t t-raw="record.record_name"/></a> + <t t-raw="record.body"/> + </div> </div> <div class="oe_clear"/> <ul class="oe_mail_msg_footer"> + <li t-if="record.subject & params.thread_level > 0"><a t-attf-href="#model=#{params.res_model}&id=#{params.res_id}"><t t-raw="record.record_name"/></a></li> + <li><a t-attf-href="#model=res.users&id=#{record.user_id[0]}"><t t-raw="record.user_id[1]"/></a></li> <li><span t-att-title="record.date"><t t-raw="record.timerelative"/></span></li> <li t-if="display['show_reply']"><a href="#" class="oe_mail_msg_reply">Reply</a></li> <!-- uncomment when merging vote @@ -160,8 +161,8 @@ --> <li t-if="record.attachment_ids.length > 0"> <a href="#" class="oe_mail_msg_view_attachments"> - <t t-if="record.attachment_ids.length == 1">Attachment</t> - <t t-if="record.attachment_ids.length > 1">Attachments (<t t-raw="record.attachment_ids.length"/>)</t> + <t t-if="record.attachment_ids.length == 1">1 Attachment</t> + <t t-if="record.attachment_ids.length > 1"><t t-raw="record.attachment_ids.length"/> Attachments</t> </a> </li> </ul> |
