diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-07-04 15:57:03 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-07-19 13:58:34 +0200 |
| commit | 915da49d173e9ab8d0c6d94cbeec124c83d23fc7 (patch) | |
| tree | d7fe30d4a4c7f1a6923b88c91ac98582ee6500f4 /addons/mail/static/src/xml/thread.xml | |
| parent | ec8c505bc1c9ec21939e9ffef53a9cc6f63f30c7 (diff) | |
[IMP] mail, *: template rendering with abstract thread, adapt thread instantiation, thread `getMessages`/`fetchMessages`, and create mode document thread.
* = im_livechat, im_support
- thread widget now uses abstract thread in `render` method
- thread models have their `init` parameters changed, so that the parent may be optional
- reworked 'creating a new record...' in chatter in create mode:
> new model CreateModeDocumentThread, which basically is a fake document thread
with a fake message for its rendering in create mode of the chatter
> special rendering method of thread_widget for such case: `renderChatterCreateMode`
- renamed thread methods previously named `getMessages` to `fetchMessages`:
> in order to not conflict with `getMessages`, used for rendering
> now, `getMessages` always get messages that are locally,
while `fetchMessages` may fetch messages.
TODO:
- special thread model for im_livechat (rendering is broken ATM)
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 6bd704fd784..2d877068694 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -3,10 +3,6 @@ <!-- @param {mail.model.AbstractThread} thread - @param {Object[]} hideAuthorMessages dict where key is message ID and - value is boolean. It tells whether the message with this ID should - hide the author visually or not. - @param {Object} options @param {boolean} [options.displayEmptyThread] @param {boolean} [options.displayLoadMore] @param {boolean} [options.displayNoMatchFound] @@ -159,7 +155,12 @@ </t> <!-- + @param {mail.model.AbstractThread} thread @param {string} dateFormat + @param {Object[]} hideAuthorMessages dict where key is message ID and + value is boolean. It tells whether the message with this ID should + hide the author visually or not. + @param {Object} options @param {mail.model.AbstractMessage} message @param {Object} options @param {boolean} [options.displayAvatars] @@ -172,13 +173,12 @@ @param {string|integer} [options.messagesSeparatorPosition] 'top' or message ID, the separator is placed just after this message. @param {integer} [options.selectedMessageID] - @param {string|integer} [options.threadID] --> <t t-name="mail.widget.Thread.Message"> <div t-att-class="'o_thread_message' + (message.getID() === options.selectedMessageID ? 'o_thread_selected_message ' : ' ') + (message.isDiscussion() or message.isNotification() ? ' o_mail_discussion' : ' o_mail_not_discussion')" t-att-data-message-id="message.getID()"> <div t-if="options.displayAvatars" class="o_thread_message_sidebar"> <t t-if="message.hasAuthor()"> - <img t-if="message.shouldDisplayAuthor()" + <img t-if="displayAuthorMessages[message.getID()]" alt="" t-att-src="message.getAvatarSource()" data-oe-model="res.partner" @@ -186,20 +186,20 @@ t-attf-class="o_thread_message_avatar img-circle #{message.shouldRedirectToAuthor() ? 'o_mail_redirect' : ''}"/> </t> <t t-else=""> - <img t-if="message.shouldDisplayAuthor()" + <img t-if="displayAuthorMessages[message.getID()]" alt="" t-att-src="message.getAvatarSource()" class="o_thread_message_avatar img-circle"/> </t> - <span t-if="!message.shouldDisplayAuthor()" t-att-title="message.getDate().format(dateFormat)" class="o_thread_message_side_date"> + <span t-if="!displayAuthorMessages[message.getID()]" t-att-title="message.getDate().format(dateFormat)" class="o_thread_message_side_date"> <t t-esc="message.getDate().format('hh:mm')"/> </span> - <i t-if="!message.shouldDisplayAuthor() and options.displayStars and message.getType() !== 'notification'" + <i t-if="!displayAuthorMessages[message.getID()] and options.displayStars and message.getType() !== 'notification'" t-att-class="'fa o_thread_message_star o_thread_icon ' + (message.isStarred() ? 'fa-star' : 'fa-star-o')" t-att-data-message-id="message.getID()" title="Mark as Todo" role="img" aria-label="Mark as todo"/> </div> <div class="o_thread_message_core"> - <p t-if="message.shouldDisplayAuthor()" class="o_mail_info text-muted"> + <p t-if="displayAuthorMessages[message.getID()]" class="o_mail_info text-muted"> <input t-if="message.needsModeration() and message.needsModerationByUser()" type="checkbox" class="moderation_checkbox" t-att-data-message-id="message.getID()"/> <t t-if="message.isNote()"> Note by @@ -223,7 +223,7 @@ <t t-if="message.isLinkedToDocumentThread() and options.displayDocumentLinks"> on <a t-att-href="message.getURL()" t-att-data-oe-model="message.getDocumentModel()" t-att-data-oe-id="message.getDocumentID()" class="o_document_link"><t t-esc="message.getDocumentName()"/></a> </t> - <t t-if="message.originatesFromChannel() and (message.getOriginChannelID() !== options.threadID)"> + <t t-if="message.originatesFromChannel() and (message.getOriginChannelID() !== thread.getID())"> (from <a t-att-data-oe-id="message.getOriginChannelID()" href="#">#<t t-esc="message.getOriginChannelName()"/></a>) </t> <span t-if="options.displayEmailIcons and message.hasCustomerEmailData()" class="o_thread_tooltip_container"> |
