[FIX] (website_)mass_mailing: remove website dependency (once and for all?)

mass_mailing snippets contained links to "/page/contactus", url which
only exists if website is installed. Also, t-if="website" which were
in snippets were unclean.

Now, the website_mass_mailing module which was already there to install
website snippet and which was already in auto-install with website and
mass_mailing is also in charge of extending mass_mailing features. It
extends the snippets to add the parts which were marked with t-if
website and add the links to "/page/contactus".
This commit is contained in:
qsm-odoo
2016-09-30 18:07:14 +02:00
parent 91a1448825
commit cc54a2e6ff
2 changed files with 70 additions and 100 deletions
+2 -100
View File
@@ -84,30 +84,6 @@
</a>
&amp;nbsp;
</td>
<td width="30%" class="text-right o_mail_no_resize">
<div t-if="website" class="o_mail_header_social">
<t t-if="website.social_facebook">
<a t-att-href="website.social_facebook">
<span class="fa fa-facebook"></span>
</a>
</t>
<t t-if="website.social_googleplus">
<a t-att-href="website.social_googleplus" style="margin-left:10px">
<span class="fa fa-google-plus"></span>
</a>
</t>
<t t-if="website.social_linkedin">
<a t-att-href="website.social_linkedin" style="margin-left:10px">
<span class="fa fa-linkedin"></span>
</a>
</t>
<t t-if="website.social_twitter">
<a t-att-href="website.social_twitter" style="margin-left:10px">
<span class="fa fa-twitter"></span>
</a>
</t>
</div>
</td>
</tr>
</table>
</div>
@@ -128,30 +104,6 @@
</h3>
&amp;nbsp;
</td>
<td width="30%" class="text-right o_mail_no_resize">
<div t-if="website" class="o_mail_header_social">
<t t-if="website.social_facebook">
<a t-att-href="website.social_facebook">
<span class="fa fa-facebook"></span>
</a>
</t>
<t t-if="website.social_googleplus">
<a t-att-href="website.social_googleplus" style="margin-left:10px">
<span class="fa fa-google-plus"></span>
</a>
</t>
<t t-if="website.social_linkedin">
<a t-att-href="website.social_linkedin" style="margin-left:10px">
<span class="fa fa-linkedin"></span>
</a>
</t>
<t t-if="website.social_twitter">
<a t-att-href="website.social_twitter" style="margin-left:10px">
<span class="fa fa-twitter"></span>
</a>
</t>
</div>
</td>
</tr>
</table>
</div>
@@ -765,35 +717,9 @@
<div class="o_mail_snippet_general">
<table align="center" cellspacing="0" cellpadding="0" class="o_mail_table_styles o_mail_full_width_padding">
<tbody>
<tr t-if="website">
<td class="o_mail_footer_social">
&amp;nbsp;
<t t-if="website.social_facebook">
<a t-att-href="website.social_facebook" class="btn btn-link">
<span class="fa fa-facebook"></span>
</a>
</t>
<t t-if="website.social_googleplus">
<a t-att-href="website.social_googleplus" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-google-plus"></span>
</a>
</t>
<t t-if="website.social_linkedin">
<a t-att-href="website.social_linkedin" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-linkedin"></span>
</a>
</t>
<t t-if="website.social_twitter">
<a t-att-href="website.social_twitter" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-twitter"></span>
</a>
</t>
&amp;nbsp;
</td>
</tr>
<tr>
<td class="o_mail_footer_links">
<a href="/unsubscribe_from_list" class="btn btn-link">Unsubscribe</a> | <a href="/page/contactus" class="btn btn-link">Contact</a>
<a href="/unsubscribe_from_list" class="btn btn-link">Unsubscribe</a>
</td>
</tr>
<tr>
@@ -818,36 +744,12 @@
<strong><t t-esc="res_company.partner_id.name"/></strong>
</p>
<div class="o_mail_footer_links">
<a href="/unsubscribe_from_list" class="btn btn-link">Unsubscribe</a> | <a href="/page/contactus" class="btn btn-link">Contact</a>
<a href="/unsubscribe_from_list" class="btn btn-link">Unsubscribe</a>
</div>
<div>
<p class="o_mail_footer_copy"><span class="fa fa-copyright"/> 2016 All Rights Reserved</p>
</div>
</td>
<td t-if="website" class="o_mail_footer_social">
&amp;nbsp;
<t t-if="website.social_facebook">
<a t-att-href="website.social_facebook" class="btn btn-link">
<span class="fa fa-facebook"></span>
</a>
</t>
<t t-if="website.social_googleplus">
<a t-att-href="website.social_googleplus" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-google-plus"></span>
</a>
</t>
<t t-if="website.social_linkedin">
<a t-att-href="website.social_linkedin" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-linkedin"></span>
</a>
</t>
<t t-if="website.social_twitter">
<a t-att-href="website.social_twitter" style="padding-left:10px;" class="btn btn-link">
<span class="fa fa-twitter"></span>
</a>
</t>
&amp;nbsp;
</td>
</tr>
</tbody>
</table>
@@ -77,4 +77,72 @@
</div>
</xpath>
</template>
<!-- Extend default mass_mailing snippets with website feature -->
<template id="social_links">
<t t-if="website.social_facebook">
<a t-att-href="website.social_facebook">
<span class="fa fa-facebook"></span>
</a>
</t>
<t t-if="website.social_googleplus">
<a t-att-href="website.social_googleplus" style="margin-left:10px">
<span class="fa fa-google-plus"></span>
</a>
</t>
<t t-if="website.social_linkedin">
<a t-att-href="website.social_linkedin" style="margin-left:10px">
<span class="fa fa-linkedin"></span>
</a>
</t>
<t t-if="website.social_twitter">
<a t-att-href="website.social_twitter" style="margin-left:10px">
<span class="fa fa-twitter"></span>
</a>
</t>
</template>
<template id="s_mail_block_header_social" inherit_id="mass_mailing.s_mail_block_header_social">
<xpath expr="//td[hasclass('o_mail_logo_container')]" position="after">
<td width="30%" class="text-right o_mail_no_resize">
<div class="o_mail_header_social">
<t t-call="website_mass_mailing.social_links"/>
</div>
</td>
</xpath>
</template>
<template id="s_mail_block_header_text_social" inherit_id="mass_mailing.s_mail_block_header_text_social">
<xpath expr="//table//td" position="after">
<td width="30%" class="text-right o_mail_no_resize">
<div class="o_mail_header_social">
<t t-call="website_mass_mailing.social_links"/>
</div>
</td>
</xpath>
</template>
<template id="s_mail_block_footer_social" inherit_id="mass_mailing.s_mail_block_footer_social">
<xpath expr="//td[hasclass('o_mail_footer_links')]" position="inside">
<t> | <a href="/page/contactus" class="btn btn-link">Contact</a></t>
</xpath>
<xpath expr="//tr" position="before">
<tr>
<td class="o_mail_footer_social">
<t t-call="website_mass_mailing.social_links"/>
</td>
</tr>
</xpath>
</template>
<template id="s_mail_block_footer_social_left" inherit_id="mass_mailing.s_mail_block_footer_social_left">
<xpath expr="//div[hasclass('o_mail_footer_links')]" position="inside">
<t> | <a href="/page/contactus" class="btn btn-link">Contact</a></t>
</xpath>
<xpath expr="//td" position="after">
<td class="o_mail_footer_social">
<t t-call="website_mass_mailing.social_links"/>
</td>
</xpath>
</template>
</odoo>