diff options
| author | Tejas Tank <tta@openerp.com> | 2012-07-16 17:16:51 +0530 |
|---|---|---|
| committer | Tejas Tank <tta@openerp.com> | 2012-07-16 17:16:51 +0530 |
| commit | d5d2e420161e7ecdbdbecedd8b47c54033af3c8a (patch) | |
| tree | 8c5d9674e5c8f215206b5557945fbfd87d5a99c1 /addons/mail/static/src | |
| parent | c50debfbd328c472c2c247bfb66d768256fe994b (diff) | |
| parent | 08d2eb4828398b2deae80bb7d7bcd7436db1bb57 (diff) | |
[IMP] code improve and merge with latest.
bzr revid: tta@openerp.com-20120716114651-19wmcwhj7f6b4qj9
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail_group.css | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/img/icon.png | bin | 0 -> 5754 bytes | |||
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 18 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 4 |
4 files changed, 17 insertions, 7 deletions
diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index 048b7a06415..b03be086fc6 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -16,7 +16,7 @@ } /* Resize footer width */ -.openerp .oe_form footer.openerp_mail_group_footer { +.openerp .oe_form div.oe_mail_group_footer { max-width: 80%; } diff --git a/addons/mail/static/src/img/icon.png b/addons/mail/static/src/img/icon.png Binary files differnew file mode 100644 index 00000000000..53ccc469127 --- /dev/null +++ b/addons/mail/static/src/img/icon.png diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 3c0b61c173e..2140bbe474a 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -91,7 +91,7 @@ openerp.mail = function(session) { this.params = params; this.params.parent_id = this.params.parent_id || false; this.params.thread_level = this.params.thread_level || 0; - this.params.msg_more_limit = this.params.msg_more_limit || 100; + this.params.msg_more_limit = this.params.msg_more_limit || 290; this.params.limit = this.params.limit || 100; this.params.offset = this.params.offset || 0; this.params.records = this.params.records || null; @@ -304,7 +304,6 @@ openerp.mail = function(session) { // 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')); // expand feature @@ -541,7 +540,11 @@ openerp.mail = function(session) { this._super.apply(this, arguments); var self = this; this.reinit(); - if (! this.view.datarecord.id) { this.$element.find('.oe_mail_thread').hide(); return; } + if (! this.view.datarecord.id || + session.web.BufferedDataSet.virtual_id_regex.test(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 @@ -635,6 +638,7 @@ openerp.mail = function(session) { start: function () { this._super.apply(this, arguments); var self = this; + this.display_current_user(); // add events this.add_event_handlers(); // load mail.message search view @@ -694,6 +698,14 @@ openerp.mail = function(session) { }); }, + display_current_user: function () { + return this.$element.find('img.oe_mail_msg_image').attr('src', this.thread_get_avatar('res.users', 'avatar', this.session.uid)); + }, + + thread_get_avatar: function(model, field, id) { + return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || ''); + }, + /** * Initializes the wall and calls fetch_comments * @param {Number} limit: number of notifications to fetch diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 2eb3a390933..982fb8aeb2f 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -56,9 +56,7 @@ <div t-name="mail.Thread" class="oe_mail oe_mail_thread"> <div class="oe_mail_thread_action"> <img class="oe_mail_msg_image oe_left" alt="User img"/> - <div class="oe_mail_msg_content"> - <textarea class="oe_mail oe_mail_action_textarea" placeholder="Add your comment here..." onfocus="this.value = '';"/> - </div> + <textarea class="oe_mail oe_mail_action_textarea" placeholder="Add your comment here..." onfocus="this.value = '';"/> </div> <div class="oe_mail_thread_display"></div> <div class="oe_mail_thread_more"> |
