[FIX] website, social_media, mass_mailing: add default value for missing media
+ add instagram This commit closes #26644 and closes #26649
This commit is contained in:
committed by
Jeremy Kersten
parent
52300d7fb0
commit
288bcccc8e
@@ -5,5 +5,8 @@
|
||||
<field name="social_facebook">https://www.facebook.com/Odoo</field>
|
||||
<field name="social_googleplus">https://plus.google.com/+Odooapps</field>
|
||||
<field name="social_linkedin">https://www.linkedin.com/company/odoo</field>
|
||||
<field name="social_youtube">https://www.youtube.com/user/OpenERPonline</field>
|
||||
<field name="social_github">https://github.com/odoo</field>
|
||||
<field name="social_instagram">https://www.instagram.com/explore/tags/odoo/</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -13,3 +13,4 @@ class Company(models.Model):
|
||||
social_linkedin = fields.Char('LinkedIn Account')
|
||||
social_youtube = fields.Char('Youtube Account')
|
||||
social_googleplus = fields.Char('Google+ Account')
|
||||
social_instagram = fields.Char('Instagram Account')
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<field name="social_linkedin"/>
|
||||
<field name="social_youtube"/>
|
||||
<field name="social_googleplus"/>
|
||||
<field name="social_instagram"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -67,6 +67,9 @@ class Website(models.Model):
|
||||
def _default_social_googleplus(self):
|
||||
return self.env.ref('base.main_company').social_googleplus
|
||||
|
||||
def _default_social_instagram(self):
|
||||
return self.env.ref('base.main_company').social_instagram
|
||||
|
||||
name = fields.Char('Website Name', required=True)
|
||||
domain = fields.Char('Website Domain')
|
||||
country_group_ids = fields.Many2many('res.country.group', 'website_country_group_rel', 'website_id', 'country_group_id',
|
||||
@@ -83,6 +86,7 @@ class Website(models.Model):
|
||||
social_linkedin = fields.Char('LinkedIn Account', default=_default_social_linkedin)
|
||||
social_youtube = fields.Char('Youtube Account', default=_default_social_youtube)
|
||||
social_googleplus = fields.Char('Google+ Account', default=_default_social_googleplus)
|
||||
social_instagram = fields.Char('Instagram Account', default=_default_social_instagram)
|
||||
|
||||
google_analytics_key = fields.Char('Google Analytics Key')
|
||||
google_management_client_id = fields.Char('Google Client ID')
|
||||
@@ -143,6 +147,7 @@ class Website(models.Model):
|
||||
self.social_linkedin = self.company_id.social_linkedin
|
||||
self.social_youtube = self.company_id.social_youtube
|
||||
self.social_googleplus = self.company_id.social_googleplus
|
||||
self.social_instagram = self.company_id.social_instagram
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Page Management
|
||||
|
||||
@@ -336,6 +336,7 @@
|
||||
<a t-if="website.social_youtube" t-att-href="website.social_youtube" class="btn btn-sm btn-link"><i class="fa fa-2x fa-youtube-play"/></a>
|
||||
<a t-if="website.social_googleplus" t-att-href="website.social_googleplus" class="btn btn-sm btn-link" rel="publisher"><i class="fa fa-2x fa-google-plus-square"/></a>
|
||||
<a t-if="website.social_github" t-att-href="website.social_github" class="btn btn-sm btn-link"><i class="fa fa-2x fa-github"/></a>
|
||||
<a t-if="website.social_instagram" t-att-href="website.social_instagram" class="btn btn-sm btn-link"><i class="fa fa-2x fa-instagram"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
|
||||
@@ -493,6 +493,7 @@
|
||||
<a t-att-href="website.social_youtube" t-if="website.social_youtube" aria-label="Youtube" title="Youtube"><i class="fa fa-youtube-play"/></a>
|
||||
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus" aria-label="Google Plus" title="Google Plus"><i class="fa fa-google-plus-square"/></a>
|
||||
<a t-att-href="website.social_github" t-if="website.social_github" aria-label="Github" title="Github"><i class="fa fa-github"/></a>
|
||||
<a t-att-href="website.social_instagram" t-if="website.social_instagram" aria-label="Instagram" title="Instagram"><i class="fa fa-instagram"/></a>
|
||||
<a t-att-href="'/blog/%s/feed' % (blog.id)" aria-label="RSS" title="RSS"><i class="fa fa-rss-square"/></a>
|
||||
</h2>
|
||||
</section>
|
||||
|
||||
@@ -87,6 +87,11 @@
|
||||
<span class="fa fa-twitter"></span>
|
||||
</a>
|
||||
</t>
|
||||
<t t-if="website.social_instagram">
|
||||
<a t-att-href="website.social_instagram" style="margin-left:10px" aria-label="Instagram" title="Instagram">
|
||||
<span class="fa fa-instagram"></span>
|
||||
</a>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="s_mail_block_header_social" inherit_id="mass_mailing.s_mail_block_header_social">
|
||||
|
||||
Reference in New Issue
Block a user