summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml/composer.xml
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2015-12-23 10:31:14 +0100
committerGéry Debongnie <ged@odoo.com>2015-12-23 14:37:41 +0100
commitc4fb2b50e0ac4248c06677f81f7a9a8324d4ffca (patch)
tree8c51b51b2e675cd40048cf26f543dd9b73e88403 /addons/mail/static/src/xml/composer.xml
parent9c2836090fa1725e9ff3b53adbbb1533b8609f15 (diff)
[IMP] mail: extended composer for mailing channels
In Discuss, when the user opens a channel, the composer was the same, regardless of the channel type. This is fine for chat channels, because we expect mostly small one liners to be written. But for mailing channels, it is a problem: it is too easy to send a mail to everyone just by typing ENTER, when the user wanted to go to the next line. This commit introduces a new widget, the extended composer, to be used for those channels. It allows the edition of the subject line, and don't sent messages when the enter key was pressed.
Diffstat (limited to 'addons/mail/static/src/xml/composer.xml')
-rw-r--r--addons/mail/static/src/xml/composer.xml35
1 files changed, 23 insertions, 12 deletions
diff --git a/addons/mail/static/src/xml/composer.xml b/addons/mail/static/src/xml/composer.xml
index 71afe4d1695..4e1a9295e3b 100644
--- a/addons/mail/static/src/xml/composer.xml
+++ b/addons/mail/static/src/xml/composer.xml
@@ -2,17 +2,21 @@
<templates xml:space="preserve">
<div t-name="mail.ChatComposer" class="o_chat_composer">
- <div class="o_composer_attachments_list"/>
- <div class="o_composer">
- <textarea class="o_composer_input" placeholder="Write something..."/>
- <div class="btn-group o_composer_buttons">
- <button class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button>
- <button class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
- <button class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
- </div>
- </div>
+ <div class="o_composer_attachments_list"/>
+ <t t-if="widget.extended">
+ <div class="o_composer_subject">
+ <input placeholder="Subject"></input>
+ <t t-call="mail.ChatComposer.Buttons"></t>
+ </div>
+ </t>
+ <div class="o_composer">
+ <textarea class="o_composer_input" placeholder="Write something..."/>
+ <t t-if="!widget.extended">
+ <t t-call="mail.ChatComposer.Buttons"></t>
+ </t>
+ </div>
- <span class="hide">
+ <span class="hide">
<t t-call="HiddenInputFile">
<t t-set="fileupload_id" t-value="widget.fileupload_id"/>
<t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>
@@ -20,10 +24,17 @@
<input type="hidden" name="id" value="0"/>
<input type="hidden" name="session_id" t-att-value="widget.session.session_id"/>
</t>
- </span>
- <span class="o_composer_emoji"></span>
+ </span>
+ <span class="o_composer_emoji"></span>
</div>
+ <t t-name="mail.ChatComposer.Buttons">
+ <div class="btn-group o_composer_buttons">
+ <button class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button>
+ <button class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
+ <button class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
+ </div>
+ </t>
<t t-name="mail.ChatComposer.emojis">
<t t-foreach="emojis" t-as="emoji">
<span t-att-data-emoji="emoji.source" class="o_mail_emoji" t-att-title="emoji.description">