diff options
| -rw-r--r-- | addons/mail/static/src/js/chatter.js | 7 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/chatter.xml | 22 |
2 files changed, 19 insertions, 10 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index ec2723f7878..92dbe515a27 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -96,6 +96,11 @@ var Chatter = Widget.extend({ */ start: function () { this._$topbar = this.$('.o_chatter_topbar'); + if(!this._disableAttachmentBox) { + this.$('.o_topbar_right_area').append(QWeb.render('mail.chatter.Attachment.Button', { + count: this.record.data.message_attachment_count || 0, + })); + } // render and append the buttons this._$topbar.prepend(this._renderButtons()); // start and append the widgets @@ -455,8 +460,6 @@ var Chatter = Widget.extend({ logNoteButton: this.hasLogButton, scheduleActivityButton: !!this.fields.activity, isMobile: config.device.isMobile, - disableAttachmentBox: this._disableAttachmentBox, - count: this.record.data.message_attachment_count || 0, }); }, /** diff --git a/addons/mail/static/src/xml/chatter.xml b/addons/mail/static/src/xml/chatter.xml index 8a7de19eda0..40e26a811b0 100644 --- a/addons/mail/static/src/xml/chatter.xml +++ b/addons/mail/static/src/xml/chatter.xml @@ -121,14 +121,20 @@ <button t-if="scheduleActivityButton" class="btn btn-link o_chatter_button_schedule_activity" title="Log or schedule an activity" disabled="disabled"> <i class="fa fa-clock-o" role="img" aria-label="Dates" title="Dates"/> <t t-if="isMobile">Activity</t><t t-else="">Schedule activity</t> </button> - <t t-if="!disableAttachmentBox"> - <button class="btn btn-link o_chatter_button_attachment" title="View all the attachments of the current record"> - <span> - <i class="fa fa-paperclip"/> - <span class="o_chatter_attachment_button_count" t-esc="count"/> - </span> - </button> - </t> + </t> + + <!-- + Chatter attachment paperclip button. + + @param {integer} [count] + --> + <t t-name="mail.chatter.Attachment.Button"> + <button class="btn btn-link o_chatter_button_attachment" title="View all the attachments of the current record"> + <span> + <i class="fa fa-paperclip"/> + <span class="o_chatter_attachment_button_count" t-esc="count"/> + </span> + </button> </t> <!-- |
