Skip to Content
Menu
This question has been flagged
2582 Views

Hi, i'm trying to extend composer to change the 'send' button removing the text and placing an icon, from mail module

<templates xml:space="preserve">
     <div t-name="mail.ChatComposer" class="o_chat_composer">
         <div class="o_composer_attachments_list"/>
         <t t-if="widget.extended">
             <div class="o_composer_subject">
                 <input tabindex="1" type="text" placeholder="Subject"></input>
                 <div class="btn-group o_composer_buttons">
                    <button tabindex="3" class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button>
                    <button tabindex="4" class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
                    <button tabindex="5" class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
                 </div>
             </div>
         </t>
         <div t-attf-class="o_composer #{widget.extended ? 'o_extended_composer' : ''}">
             <div class="o_composer_input">
                 <textarea class="o_composer_text_field" tabindex="2" placeholder="Write something..."/>
             </div>
             <t t-if="!widget.extended">
                 <div class="btn-group o_composer_buttons">
                    <button tabindex="3" class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button>
                    <button tabindex="4" class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
                    <button tabindex="5" class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
                 </div>
             </t>
         </div>
         <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>
                <input type="hidden" name="model" value="mail.compose.message"/>
                <input type="hidden" name="id" value="0"/>
                <input type="hidden" name="session_id" t-att-value="widget.session.session_id"/>
            </t>
         </span>
         <span t-att-class="widget.emoji_container_classname"></span>
    </div>

My current approach:

<t t-extend="mail.ChatComposer">
<t t-jquery=".o_chat_composer" t-operation="replace">
<t t-if="widget.extended">
<div class="o_composer_subject">
<input tabindex="1" type="text" placeholder="Subject"></input>
<div class="btn-group o_composer_buttons">
<button tabindex="4" class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
<button tabindex="5" class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
<button tabindex="3" class="btn btn-sm btn-primary o_composer_button_send" type="button"><t t-esc="widget.options.send_text"/></button>
</div>
</div>
</t>
<div t-attf-class="o_composer #{widget.extended ? 'o_extended_composer' : ''}">
<div class="o_composer_input">
<textarea class="o_composer_text_field" tabindex="2" placeholder="Write something..."/>
</div>
<t t-if="!widget.extended">
<div class="btn-group o_composer_buttons">
<button tabindex="4" class="btn btn-sm btn-icon fa fa-smile-o o_composer_button_emoji" type="button" data-toggle="popover"/>
<button tabindex="5" class="btn btn-sm btn-icon fa fa-paperclip o_composer_button_add_attachment" type="button"/>
<button tabindex="3" class="btn btn-sm btn-icon fa fa-send o_composer_button_send" type="button"/><!--<t t-esc="widget.options.send_text"/></button>-->
</div>
</t>
</div>
</t>
</t>

But is not working at all, of course i have the file referenced in qweb part of manifest file.


Any idea of what i'm doing wrong?


Avatar
Discard
Related Posts Replies Views Activity
1
Mar 22
2654
0
Jan 20
4022
1
Nov 17
4549
2
Nov 17
5563
1
Mar 15
5416