summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2014-02-12 18:51:41 +0100
committerOlivier Dony <odo@openerp.com>2014-02-12 18:51:41 +0100
commitbbd813e76e9fc4d261c12761dd40a0856ef743a7 (patch)
treed48d1c048233b0108bb111a7f5840d2a06f67bef /addons/mail/static/src
parenta7e5025f29951805bfb0d9609d311afa3cad985c (diff)
parent65257c48b5654a03d7d0679be13202ee715a753a (diff)
[MERGE] Forward-port of latest saas-2 (incl. 7.0) bugfixes, up to rev. 9127 odo@openerp.com-20140212122042-3m2tysmr31mtecnc
bzr revid: odo@openerp.com-20140212175141-i9yz8zlseglrk8sb
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/mail_followers.js4
-rw-r--r--addons/mail/static/src/xml/mail.xml34
-rw-r--r--addons/mail/static/src/xml/mail_followers.xml4
3 files changed, 20 insertions, 22 deletions
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index 938d6a01f6d..c103e4d4ab2 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -197,6 +197,7 @@ openerp_mail_followers = function(session, mail) {
// clean and display title
var node_user_list = this.$('.oe_follower_list').empty();
this.$('.oe_follower_title').html(this._format_followers(this.followers.length));
+ self.message_is_follower = _.indexOf(this.followers.map(function (rec) { return rec[2]['is_uid']}), true) != -1;
// truncate number of displayed followers
var truncated = this.followers.slice(0, this.displayed_nb);
_(truncated).each(function (record) {
@@ -207,9 +208,6 @@ openerp_mail_followers = function(session, mail) {
'is_editable': record[2]['is_editable'],
'avatar_url': mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record[0]),
}
- if (partner.is_uid) {
- self.message_is_follower = partner.is_uid;
- }
$(session.web.qweb.render('mail.followers.partner', {'record': partner, 'widget': self})).appendTo(node_user_list);
// On mouse-enter it will show the edit_subtype pencil.
if (partner.is_editable) {
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 3a7a5469ee1..9696fab789d 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -135,14 +135,14 @@
<t t-if="widget.is_private or (widget.user_pid != partner[0])">
<t t-if="!widget.is_private and inc==0"> and </t>
<span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/>
- <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a>
- <t t-if="!widget.options.show_link" t-raw="partner[1]"/>
+ <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-esc="partner[1]"/></a>
+ <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
</span>
<t t-set="inc" t-value="inc+1"/>
</t>
</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>
+ <span class="oe_more">, <a><t t-esc="widget.partner_ids.length - 3"/> others...</a></span>
<a class="oe_more_hidden">&lt;&lt;&lt;</a>
</t>
</div>
@@ -150,8 +150,8 @@
<t t-foreach='widget.recipients' t-as='recipient'>
<label t-attf-title="Add as recipient and follower (reason: #{recipient.reason})">
<input type="checkbox" t-att-checked="recipient.checked ? 'checked' : undefined" t-att-data="recipient.full_name"/>
- <t t-raw="recipient.name"/>
- <t t-if="recipient.email_address">(<t t-raw="recipient.email_address"/>)</t>
+ <t t-esc="recipient.name"/>
+ <t t-if="recipient.email_address">(<t t-esc="recipient.email_address"/>)</t>
<t t-if="!recipient.email_address">(no email address)</t>
</label>
</t>
@@ -177,7 +177,7 @@
<td colspan="2">
<h2 class="oe_view_title">
<span class="oe_view_title_text">
- <t t-raw="widget.action.name"/>
+ <t t-esc="widget.action.name"/>
</span>
</h2>
<t t-if="widget.action.params.header_description">
@@ -263,11 +263,11 @@
<div class="oe_msg_content">
<h1 t-if="(widget.show_record_name or widget.subject) and !widget.thread_level" class="oe_msg_title">
<a t-if="widget.options.show_link and widget.show_record_name" class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&amp;id=#{widget.res_id}">
- <t t-raw="widget.record_name"/>
+ <t t-esc="widget.record_name"/>
</a>
- <span t-if="!widget.options.show_link and widget.show_record_name"><t t-raw="widget.record_name"/></span>
+ <span t-if="!widget.options.show_link and widget.show_record_name"><t t-esc="widget.record_name"/></span>
<t t-if="widget.show_record_name and widget.subject">: </t>
- <t t-if="widget.subject" t-raw="widget.subject"/>
+ <t t-if="widget.subject" t-esc="widget.subject"/>
</h1>
<div class="oe_msg_body">
<t t-if="widget.body_short">
@@ -283,8 +283,8 @@
<t t-if="widget.attachment_ids.length > 0">
<div class="oe_msg_attachment_list"></div>
</t>
- <a t-if="widget.author_id and widget.options.show_link and widget.author_id[0]" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}"><t t-raw="widget.author_id[2]"/></a>
- <span t-if="widget.author_id and (!widget.options.show_link or !widget.author_id[0])"><t t-raw="widget.author_id[2]"/></span>
+ <a t-if="widget.author_id and widget.options.show_link and widget.author_id[0]" t-attf-href="#model=res.partner&amp;id=#{widget.author_id[0]}"><t t-esc="widget.author_id[2]"/></a>
+ <span t-if="widget.author_id and (!widget.options.show_link or !widget.author_id[0])"><t t-esc="widget.author_id[2]"/></span>
<t t-if="widget.type == 'notification'">
updated document
<t t-if="widget.partner_ids.length > 0">
@@ -303,20 +303,20 @@
<t t-if="widget.type == 'notification' or ( (widget.type == 'email' or widget.type == 'comment') and (widget.subtype or widget.partner_ids.length > 0))"
t-foreach="widget.partner_ids.slice(0, 3)" t-as="partner">
<span t-attf-class="oe_partner_follower">
- <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-raw="partner[1]"/></a>
- <t t-if="!widget.options.show_link" t-raw="partner[1]"/>
+ <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&amp;id=#{partner[0]}"><t t-esc="partner[1]"/></a>
+ <t t-if="!widget.options.show_link" t-esc="partner[1]"/>
</span>
<t t-if="!partner_last">,</t>
</t>
<t t-if="widget.partner_ids.length > 3">
- <span t-att-title="widget.extra_partners_str">and <t t-raw="widget.extra_partners_nbr"/> more</span>
+ <span t-att-title="widget.extra_partners_str">and <t t-esc="widget.extra_partners_nbr"/> more</span>
</t>
<t t-if="widget.type == 'notification' and widget.partner_ids.length > 0">
notified
</t>
<span class='oe_subtle'>•</span>
<span t-att-title="widget.date">
- <t t-if="widget.timerelative" t-raw="widget.timerelative"/>
+ <t t-if="widget.timerelative" t-esc="widget.timerelative"/>
<t t-if="!widget.timerelative" t-raw="widget.display_date"/>
</span>
<span t-if="!widget.options.readonly" class='oe_subtle'>•</span>
@@ -333,7 +333,7 @@
<div class='oe_separator'></div>
<a t-if="widget.nb_messages &lt;= 0" class="oe_msg_fetch_more">show more message</a>
<a t-if="widget.nb_messages === 1" class="oe_msg_fetch_more">show one more message</a>
- <a t-if="widget.nb_messages &gt; 1" class="oe_msg_fetch_more">show <t t-raw="widget.nb_messages" /> more messages</a>
+ <a t-if="widget.nb_messages &gt; 1" class="oe_msg_fetch_more">show <t t-esc="widget.nb_messages" /> more messages</a>
</div>
</div>
</t>
@@ -353,7 +353,7 @@
-->
<span t-name="mail.thread.message.vote">
<span class="oe_mail_vote_count" t-if='widget.vote_nb > 0'>
- <t t-raw='widget.vote_nb' />
+ <t t-esc='widget.vote_nb' />
<span class='oe_e'>8</span>
</span>
<a href='#' class="oe_msg_vote">
diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml
index a936b8237d6..6e8682cb533 100644
--- a/addons/mail/static/src/xml/mail_followers.xml
+++ b/addons/mail/static/src/xml/mail_followers.xml
@@ -43,13 +43,13 @@
<table class='oe_subtype'>
<tr>
<td width="10%"><input type="checkbox" t-att-checked="record.followed" t-att-id="'input_mail_followers_subtype_'+record.id" t-att-data-id="record.id" t-att-name="record.name" class="oe_msg_subtype_check"/></td>
- <td><label t-att-for="'input_mail_followers_subtype_'+record.id"><t t-raw="record.name"/></label></td>
+ <td><label t-att-for="'input_mail_followers_subtype_'+record.id"><t t-esc="record.name"/></label></td>
</tr>
</table>
</t>
<t t-name="mail.followers.show_more">
- <div class="oe_partner oe_show_more">And <t t-raw="number"/> more.</div>
+ <div class="oe_partner oe_show_more">And <t t-esc="number"/> more.</div>
</t>
</template>