diff options
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail.css | 4 | ||||
| -rw-r--r-- | addons/mail/static/src/css/mail_group.css | 43 | ||||
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 37 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 20 |
4 files changed, 66 insertions, 38 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 2421b28fbcb..0cf932f9a25 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -314,8 +314,8 @@ text-align: justify; } -.openerp .oe_mail_msg_tail { - display: none; +.openerp .oe_mail_msg_body span.oe_mail_msg_tail { + display: inline; } /* Read more/less link */ diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index 90261499753..048b7a06415 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -1,3 +1,40 @@ +/* ------------------------------ */ +/* Group Form */ +/* ------------------------------ */ + +/* Resize sheet width */ +.openerp .oe_form_sheetbg.openerp_mail_group_sheet { + min-height: 0px; + max-height: none; +} + +.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_sheet { + min-height: 0px; + max-height: none; + padding: 0px 18px; + max-width: 80%; +} + +/* Resize footer width */ +.openerp .oe_form footer.openerp_mail_group_footer { + max-width: 80%; +} + +/* Resize group logo */ +.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_image > img { + max-width: 100px; + max-height: 100px; +} + +/* Resize group description */ +.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea { + height: 40px; +} + +/* ------------------------------ */ +/* Group Kanban */ +/* ------------------------------ */ + .oe_group_vignette { padding: 8px 0; min-height: 100px; @@ -71,9 +108,3 @@ .oe_group_details li { margin: 2px 0; } - -.oe_group_description { -} - -.oe_kanban_record div.true { -} diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 5633a4bdae0..3c0b61c173e 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -302,17 +302,20 @@ openerp.mail = function(session) { record.body = this.do_clean_text(record.body); record.body = this.do_replace_internal_links(record.body); - // split for see more - var split = this.do_truncate_string(record.body, this.params.msg_more_limit); - record.body_head = split[0]; - record.body_tail = split[1]; - // format date according to the user timezone record.date = session.web.format_value(record.date, {type:"datetime"}); - 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')); + $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first')); + // expand feature + this.$element.find('div.oe_mail_msg_body:last').expander({ + slicePoint: this.params.msg_more_limit, + expandText: 'see more', + userCollapseText: 'see less', + detailClass: 'oe_mail_msg_tail', + moreClass: 'oe_mail_expand', + lesClass: 'oe_mail_reduce', + }); }, /** @@ -447,20 +450,6 @@ openerp.mail = function(session) { return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || ''); }, - /** - * @param {String} string to truncate - * @param {Number} max number of chars to display - * @returns {String} truncated string - */ - do_truncate_string: function(string, max_length) { - // multiply by 1.2: prevent truncating an just too little long string - if (string.length <= (max_length * 1.2)) { - return [string, ""]; - } else { - return [string.slice(0, max_length), string.slice(max_length)]; - } - }, - /** Removes html tags, except b, em, br */ do_clean_text: function (string) { var html = $('<div/>').text(string.replace(/\s+/g, ' ')).html().replace(new RegExp('<(/)?(b|em|br|br /)\\s*>', 'gi'), '<$1$2>'); @@ -508,7 +497,7 @@ openerp.mail = function(session) { }); session.web.form.widgets.add( 'Thread', 'openerp.mail.Thread'); - /** ThreadView widget: thread of comments */ + /** mail_thread widget: thread of comments */ mail.RecordThread = session.web.form.AbstractField.extend({ template: 'mail.RecordThread', @@ -565,7 +554,7 @@ openerp.mail = function(session) { }, fetch_subscribers: function () { - return this.ds.call('message_get_subscribers', [[this.view.datarecord.id]]).then(this.proxy('display_subscribers')); + return this.ds.call('message_read_subscribers', [[this.view.datarecord.id]]).then(this.proxy('display_subscribers')); }, display_subscribers: function (records) { @@ -609,7 +598,7 @@ openerp.mail = function(session) { return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || ''); }, }); - session.web.form.widgets.add( 'ThreadView', 'openerp.mail.RecordThread'); + session.web.form.widgets.add( 'mail_thread', 'openerp.mail.RecordThread'); /** WallView widget: a wall of messages */ mail.WallView = session.web.Widget.extend({ diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 5ff8a996116..2eb3a390933 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -1,12 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> <template> - <div t-name="mail.Wall" class="oe_mail_wall"> + <div t-name="mail.Wall" class="oe_view_manager oe_mail_wall oe_view_manager_global"> <table class="oe_view_manager_header"> + <colgroup> + <col width="33%"/> + <col width="33%"/> + <col width="34%"/> + </colgroup> + <tbody> <tr class="oe_header_row"> - <td><h2 class="oe_view_title">All Feeds</h2></td> + <td colspan="2"> + <h2 class="oe_view_title"> + <span class="oe_view_title_text">All Feeds</span> + </h2> + </td> <td><div class="oe_view_manager_view_search" t-opentag="true"/></td> </tr> + </tbody> </table> <div class="oe_mail_wall_main"> <div class="oe_mail_wall_action"> @@ -80,10 +91,7 @@ </div> <div class="oe_mail_msg_body"> <a href="#" data-res-model='res.users' t-attf-data-res-id='{record.user_id[0]}' class="oe_mail_internal_link"><t t-raw="record.user_id[1]"/></a> - <t t-raw="record.body_head"/> - <t t-if="record.body_tail"><a href="#" class="oe_mail_msg_more">... See more</a> - <span class="oe_mail_msg_tail"><t t-raw="record.body_tail"/></span> - </t> + <t t-raw="record.body"/> </div> <ul class="oe_mail_msg_footer"> <li><span t-att-title="record.date"><t t-raw="record.timerelative"/></span></li> |
