[IMP] mail: add an show_link_partner params to display partner (authors, followers...) on link or not, for portal

bzr revid: chm@openerp.com-20121122154712-4wmjfy0v8trwq4cw
This commit is contained in:
Christophe Matthieu 2012-11-22 16:47:12 +01:00
parent 81a9ce4aa4
commit 18ec2c978e
2 changed files with 11 additions and 3 deletions

View File

@ -1394,6 +1394,7 @@ openerp.mail = function (session) {
*... @param {Array} [message_ids] List of ids to fetch by the root thread.
* When you use this option, the domain is not used for the fetch root.
* @param {String} [no_message] Message to display when there are no message
* @param {Boolean} [show_link_partner] Display partner (authors, followers...) on link or not
*/
init: function (parent, action) {
this._super(parent, action);
@ -1411,6 +1412,7 @@ openerp.mail = function (session) {
'show_compose_message' : false,
'show_compact_message' : false,
'compose_placeholder': false,
'show_link_partner': true,
'view_inbox': false,
'message_ids': undefined,
}, this.action.params);

View File

@ -115,7 +115,11 @@
</t>
<t t-if="!widget.is_private and widget.partner_ids.length"> and </t>
<t t-set="inc" t-value="0"/>
<t t-if="widget.partner_ids.length" t-foreach="widget.partner_ids" t-as="partner"><span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/><a t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a></span><t t-set="inc" t-value="inc+1"/>
<t t-if="widget.partner_ids.length" t-foreach="widget.partner_ids" t-as="partner">
<span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/>
<a t-if="widget.options.show_link_partner" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a>
<t t-if="!widget.options.show_link_partner" t-raw="partner[1]"/>
</span><t t-set="inc" t-value="inc+1"/>
</t>
<t t-if="widget.partner_ids.length>=3">
<span class="oe_more">, <a><t t-raw="widget.partner_ids.length-3"/> others...</a></span>
@ -194,9 +198,10 @@
<div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_#{widget.type}">
<div class='oe_msg_left'>
<a t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
<a t-if="widget.options.show_link_partner" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
<img class="oe_msg_icon" t-att-src="widget.avatar"/>
</a>
<img t-if="!widget.options.show_link_partner" class="oe_msg_icon" t-att-src="widget.avatar"/>
</div>
<div class="oe_msg_center">
@ -221,7 +226,8 @@
<t t-if="widget.attachment_ids.length > 0">
<div class="oe_msg_attachment_list"></div>
</t>
<a t-if="widget.author_id" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}"><t t-raw="widget.author_id[1]"/></a>
<a t-if="widget.author_id and widget.options.show_link_partner" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}"><t t-raw="widget.author_id[1]"/></a>
<span t-if="widget.author_id and !widget.options.show_link_partner"><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>