diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-12-18 10:32:41 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-12-18 10:32:41 +0100 |
| commit | 2dbe4a696ecd7330b16d10ec38462fe6c8fa37ca (patch) | |
| tree | e7f1103c8b839aa1bffee9dfb961e08b3bc82e26 /addons/mail/static/src | |
| parent | 6d2a0d270f0f0b9eb7d66eb384a8803a186db374 (diff) | |
| parent | 73980eba5f64c674b0bc366c714a9a38d3bb915a (diff) | |
[MERGE] Sync wirth trunk.
bzr revid: tde@openerp.com-20121218093241-y0id5g1r1k6yok42
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 5 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index dc5583eb951..f873daff9c3 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1414,6 +1414,7 @@ openerp.mail = function (session) { * @param {String} [no_message] Message to display when there are no message * @param {Boolean} [show_link] Display partner (authors, followers...) on link or not * @param {Boolean} [compose_as_todo] The root composer mark automatically the message as todo + * @param {Boolean} [readonly] Read only mode, hide all action buttons and composer */ init: function (parent, action) { this._super(parent, action); @@ -1435,6 +1436,7 @@ openerp.mail = function (session) { 'view_inbox': false, 'message_ids': undefined, 'compose_as_todo' : false, + 'readonly' : false, }, this.action.params); this.action.params.help = this.action.help || false; @@ -1507,6 +1509,9 @@ openerp.mail = function (session) { if (this.node.attrs.placeholder) { this.node.params.compose_placeholder = this.node.attrs.placeholder; } + if (this.node.attrs.readonly) { + this.node.params.readonly = this.node.attrs.readonly; + } 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 542e4eec7b7..3c510813029 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -20,7 +20,7 @@ mail.compose_message when focus on textarea --> <t t-name="mail.compose_message"> - <div t-if="widget.show_composer" t-attf-class="oe_msg oe_msg_composer #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}"> + <div t-if="widget.show_composer and !widget.options.readonly" t-attf-class="oe_msg oe_msg_composer #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}"> <div class="oe_msg_left"> <img class="oe_msg_icon" alt="User img" t-attf-src="#{widget.avatar}"/> </div> @@ -38,7 +38,7 @@ </div> </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' : ''}"> + <div t-if="widget.show_compact_message and !widget.show_composer and !widget.options.readonly" 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.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 to the followers of this document..."/> <textarea t-if="!widget.options.compose_placeholder and widget.options.view_mailbox" class="field_text oe_compact" placeholder="Share with my followers..."/> @@ -211,7 +211,7 @@ </div> <div class="oe_msg_center"> - <div class='oe_msg_icons'> + <div class='oe_msg_icons' t-if="!widget.options.readonly"> <span class='oe_read' t-if="widget.options.show_read"><a title="Done" class="oe_e">W</a></span> <span class='oe_unread' t-if="widget.is_favorite and widget.options.show_unread"><a title="Set back to Todo" class="oe_e">v</a></span> <span class='oe_unread' t-if="!widget.is_favorite and widget.options.show_unread"><a title="Set back to Inbox" class="oe_e">v</a></span> @@ -236,8 +236,8 @@ <span t-if="widget.author_id and !widget.options.show_link"><t t-raw="widget.author_id[1]"/></span> <span class='oe_subtle'>•</span> <span t-att-title="widget.date"><t t-raw="widget.timerelative"/></span> - <span class='oe_subtle'>•</span> - <t t-call="mail.thread.message.vote"/> + <span t-if="!widget.options.readonly" class='oe_subtle'>•</span> + <t t-if="!widget.options.readonly" t-call="mail.thread.message.vote"/> </div> </div> </div> |
