summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2012-10-03 16:30:19 +0200
committerFabien Pinckaers <fp@tinyerp.com>2012-10-03 16:30:19 +0200
commit75c52c520cbc5b2c5bbcd345a0c1cf04f402f46a (patch)
tree4f15a231526e45c2c41098e4dddbf9d46a95bab8 /addons/mail/static/src
parent866b1c19fa4ed54c109b0649d900d760e19f78d8 (diff)
parent27d3070220fec3afc84d093e414fe8f72c266e7a (diff)
[FIX] open chatter
bzr revid: fp@tinyerp.com-20121003143019-ua3128jpufzcie5k
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/css/mail.css2
-rw-r--r--addons/mail/static/src/js/mail.js37
-rw-r--r--addons/mail/static/src/js/mail_followers.js5
-rw-r--r--addons/mail/static/src/xml/mail.xml9
4 files changed, 22 insertions, 31 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 364ac7e3165..4ffb9013496 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -370,7 +370,7 @@
bottom: 0px;
top: auto;
left: auto;
- right: 28px;
+ right: 0;
height: 26px;
width: 26px;
min-width: 22px;
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index e0c9ac9b7fc..8915f1387e1 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -148,8 +148,8 @@ openerp.mail = function(session) {
// handle attachment button
this.fileupload_id = _.uniqueId('oe_fileupload');
var button_attach = this.$('button.oe_mail_compose_message_attachment');
- var rendered = session.web.qweb.render('mail.compose_message.add_attachment', {'widget': this});
- $(rendered).insertBefore(button_attach);
+ var rendered = $( session.web.qweb.render('mail.compose_message.add_attachment', {'widget': this}) );
+ rendered.insertBefore(button_attach);
// move the button inside div.oe_hidden_input_file
var input_node = this.$('input[name=ufile]');
button_attach.detach().insertAfter(input_node);
@@ -256,10 +256,10 @@ openerp.mail = function(session) {
default_res_id: 0,
default_parent_id: false }, options.context || {});
- this.id = -1;
+ this.id = options.parameters.id || -1;
this.parent_id= options.parameters.parent_id || false;
this.nb_messages = options.parameters.nb_messages || 0;
- this.type = options.parameters.type || false;
+ this.type = 'expandable';
// record options and data
this.parent_thread= parent.messages!= undefined ? parent : options.options.thread._parents[0] ;
@@ -501,9 +501,6 @@ openerp.mail = function(session) {
} else {
self.destroy();
}
- for(var i in this.thread.messages){
- this.thread.messages[i].animated_destroy({fadeTime:0});
- }
},
on_message_delete: function (event) {
@@ -598,8 +595,8 @@ openerp.mail = function(session) {
display_vote: function () {
var self = this;
var vote_element = session.web.qweb.render('mail.thread.message.vote', {'widget': self});
- self.$(".placeholder-mail-vote").empty();
- self.$(".placeholder-mail-vote").html(vote_element);
+ self.$(".placeholder-mail-vote:first").empty();
+ self.$(".placeholder-mail-vote:first").html(vote_element);
},
});
@@ -879,7 +876,7 @@ openerp.mail = function(session) {
fetch_domain = replace_domain ? replace_domain : this.domain;
fetch_context = replace_context ? replace_context : this.context;
fetch_context.message_loaded= [this.id||0].concat( self.options.thread._parents[0].get_child_ids() );
-
+
return this.ds_message.call('message_read', [ids, fetch_domain, (this.options.thread.thread_level+1), fetch_context, this.context.default_parent_id || undefined]
).then(this.proxy('switch_new_message'));
},
@@ -945,11 +942,11 @@ openerp.mail = function(session) {
}
}
- if(parent_newer)
- message.insertAfter(parent_newer.$el);
- else if(parent_older)
+ if(parent_older)
message.insertBefore(parent_older.$el);
- else
+ else if(parent_newer)
+ message.insertAfter(parent_newer.$el);
+ else
message.prependTo(thread.list_ul);
return message
@@ -1098,6 +1095,7 @@ openerp.mail = function(session) {
this._super.apply(this, arguments);
var searchview_ready = this.load_searchview({}, false);
var thread_displayed = this.message_render();
+ this.options.domain = this.options.domain.concat(this.search_results['domain']);
return (searchview_ready && thread_displayed);
},
@@ -1137,19 +1135,14 @@ openerp.mail = function(session) {
/** Clean and display the threads */
message_render: function (search) {
- var domain = this.options.domain.concat(this.search_results['domain']);
-
- var domain = _.extend(this.options.domain, search&&search.domain? search.domain : {});
- var context = _.extend(this.options.context, search&&search.context ? search.context : {});
-
this.thread = new mail.Thread(this, {
- 'domain' : domain,
- 'context' : context,
+ 'domain' : this.options.domain.concat(this.search_results['domain']),
+ 'context' : _.extend(this.options.context, search&&search.search_results['context'] ? search.search_results['context'] : {}),
'options': {
'thread' :{
'thread_level': this.options.thread_level,
'use_composer': true,
- 'show_header_compose': 1,
+ 'show_header_compose': 1,
},
'message': {
'show_reply': this.options.thread_level > 0,
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index 953b8cd9fc8..ab6a63ea6fa 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -149,7 +149,6 @@ openerp_mail_followers = function(session, mail) {
var self = this;
var node_user_list = this.$('ul.oe_mail_followers_display').empty();
this.$('div.oe_mail_recthread_followers h4').html(this.options.title + (records.length>=5 ? ' (' + records.length + ')' : '') );
- console.log(records);
for(var i=0; i<records.length&&i<5; i++) {
var record=records[i];
record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id);
@@ -200,7 +199,7 @@ openerp_mail_followers = function(session, mail) {
$(record).attr('checked','checked');
});
var context = new session.web.CompoundContext(this.build_context(), {});
- return this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id], undefined, undefined, context]).pipe(function(value_){
+ return this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id], [this.session.uid], undefined, context]).pipe(function(value_){
self.read_value(value_);
if(!self.$('.oe_recthread_subtypes').is(":visible"))
self.display_subtypes(true);
@@ -212,7 +211,7 @@ openerp_mail_followers = function(session, mail) {
$(record).attr('checked',false);
});
var context = new session.web.CompoundContext(this.build_context(), {});
- return this.ds_model.call('message_unsubscribe_users', [[this.view.datarecord.id], undefined, context]).pipe(this.proxy('read_value'));
+ return this.ds_model.call('message_unsubscribe_users', [[this.view.datarecord.id], [this.session.uid], context]).pipe(this.proxy('read_value'));
},
do_update_subscription: function () {
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 07c9b406cdc..1e2e6a970b6 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -104,15 +104,14 @@
</div>
<!-- default layout -->
- <li t-name="mail.thread.message" t-attf-class="oe_mail oe_mail_thread_msg #{widget.unread?'oe_mail_unread':'oe_mail_read'}" t-attf-data-msg_id="{widget.id}">
+ <li t-name="mail.thread.message" t-attf-class="oe_mail oe_mail_thread_msg #{widget.unread?'oe_mail_unread':'oe_mail_read'}">
<div t-attf-class="oe_mail_msg_#{widget.type} oe_semantic_html_override">
<!-- message actions (read/unread, reply, delete...) -->
<ul class="oe_header">
<li class="placeholder-mail-vote"><t t-call="mail.thread.message.vote"/></li>
<li t-if="!widget.options.thread.display_on_flat and widget.unread" title="Read"><a class="oe_read oe_e">W</a></li>
<li t-if="!widget.options.thread.display_on_flat and !widget.unread" title="Set back to unread"><a class="oe_unread oe_e">h</a></li>
- <li t-if="!widget.options.message.show_reply_by_email" title="Reply"><a class="oe_reply oe_e">)</a></li>
- <li t-if="widget.options.message.show_reply_by_email"><a class="oe_reply_by_email oe_e" title="Reply by mail">)</a></li>
+ <li title="Quick reply"><a class="oe_reply oe_e">)</a></li>
<t t-if="(widget.options.message.show_reply || widget.options.message.show_reply_by_email || (widget.is_author and widget.options.message.show_dd_delete) || widget.type == 'email')">
<li>
<span class="oe_dropdown_toggle">
@@ -124,7 +123,7 @@
<a href="#" class="oe_mail_msg_hide_type" t-attf-data-subtype='{widget.subtype}'>Hide '<t t-esc="widget.subtype"/>' for this document</a>
</li> -->
<li t-if="widget.options.message.show_reply" title="Reply"><a class="oe_reply oe_full_reply">Full reply</a></li>
- <li t-if="widget.options.message.show_reply_by_email"><a class="oe_reply_by_email oe_full_reply" title="Reply by mail">Full reply</a></li>
+ <li t-if="widget.options.message.show_reply_by_email"><a class="oe_reply_by_email oe_full_reply" title="Reply by mail">Full reply by mail</a></li>
<li t-if="widget.type == 'email'"><a class="oe_mail_msg_details" t-attf-href="#model=mail.message&amp;id=#{widget.id}" >Details</a></li>
</ul>
</span>
@@ -171,7 +170,7 @@
</li>
<!-- expandable message layout -->
- <li t-name="mail.thread.expandable" t-attf-class="oe_mail oe_mail_thread_msg oe_mail_unread" t-attf-data-thread_id="{widget.id}">
+ <li t-name="mail.thread.expandable" class="oe_mail oe_mail_thread_msg oe_mail_unread">
<div t-attf-class="oe_mail_msg_#{widget.type} oe_semantic_html_override">
<div class="oe_mail_msg_content oe_mail_msg_more_message">
<a class="oe_mail_fetch_more">Load more messages <span t-if="widget.nb_messages>0">(<t t-raw="widget.nb_messages"/> messages not display)</span>...</a>