summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2012-11-15 11:05:42 +0100
committerChristophe Matthieu <chm@openerp.com>2012-11-15 11:05:42 +0100
commit3f655858d89b6910c24fa3dbc8a85adcc20a8046 (patch)
tree00e7bce25d67f7fa3efa8d6c9f05b8308073ab2a /addons/mail/static/src
parentb387836284c86d1e976487a7638d2a821459614e (diff)
[IMP] mail: the placeholder of textarea on compose message can be custom with an attribute placeholder on the field
bzr revid: chm@openerp.com-20121115100542-7gigxjnxjloqt8ue
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/mail.js7
-rw-r--r--addons/mail/static/src/xml/mail.xml13
2 files changed, 16 insertions, 4 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 006f9529272..7d874a8d1fe 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -1231,6 +1231,7 @@ openerp.mail = function (session) {
'default_parent_id': self.id,
}});
} else {
+ data.record_name= (data.record_name != '' && data.record_name) || (self.parent_message && self.parent_message.record_name);
var message = new mail.ThreadMessage(self, data, {'context':{
'default_model': data.model,
'default_res_id': data.res_id,
@@ -1447,6 +1448,7 @@ openerp.mail = function (session) {
'show_record_name' : false,
'show_compose_message' : false,
'show_compact_message' : false,
+ 'compose_placeholder': false,
'view_inbox': false,
'message_ids': undefined,
}, this.action.params);
@@ -1511,7 +1513,6 @@ openerp.mail = function (session) {
init: function (parent, node) {
this._super.apply(this, arguments);
this.node = _.clone(node);
-
this.node.params = _.extend({
'display_indented_thread': -1,
'show_reply_button': false,
@@ -1520,6 +1521,10 @@ openerp.mail = function (session) {
'show_compact_message': 1,
}, this.node.params);
+ if (this.node.attrs.placeholder) {
+ this.node.params.compose_placeholder = this.node.attrs.placeholder;
+ }
+
this.domain = this.node.params && this.node.params.domain || [];
},
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index deab58eca00..f4518dc6fa7 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -39,8 +39,9 @@
</div>
</div>
<div t-if="widget.show_compact_message and !widget.show_composer" t-attf-class="oe_msg oe_msg_composer_compact #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
- <textarea t-if="!widget.options.view_mailbox" class="field_text oe_compact" placeholder="Write to the followers of this docmuent..."/>
- <textarea t-if="widget.options.view_mailbox" class="field_text oe_compact" placeholder="Write to my followers..."/>
+ <textarea t-if="widget.options.compose_placeholder" class="field_text oe_compact" t-att-placeholder="widget.options.compose_placeholder"/>
+ <textarea t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox" class="field_text oe_compact" placeholder="Write an internal note..."/>
+ <textarea t-if="!widget.options.compose_placeholder and widget.options.view_mailbox" class="field_text oe_compact" placeholder="Share to my followers..."/>
</div>
<span t-if="!(widget.show_compact_message and !widget.show_composer) and !widget.show_composer" class="oe_placeholder_compose"></span>
</t>
@@ -109,7 +110,13 @@
<t t-name="mail.thread.list_recipients">
<div class="oe_mail_list_recipients">
To:
- <span t-if="!widget.is_private" class="oe_all_follower">Followers <t t-raw="' of ' + (widget.parent_thread.parent_message.record_name ? '&quot;' + widget.parent_thread.parent_message.record_name + '&quot;' : 'this document')"/></span>
+ <t t-if="!widget.is_private">
+ <span class="oe_all_follower">
+ Followers of
+ <t t-if="widget.parent_thread.parent_message.record_name" t-raw="'&quot;' + widget.parent_thread.parent_message.record_name + '&quot;'"/>
+ <t t-if="!widget.parent_thread.parent_message.record_name">this document</t>
+ </span>
+ </t>
<t t-if="!widget.is_private and widget.partner_ids.length"> and </t>
<t t-set="inc" t-value="0"/>
<t t-if="widget.partner_ids.length" t-foreach="widget.partner_ids" t-as="partner"><span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/><a t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a></span><t t-set="inc" t-value="inc+1"/>