Browse Source

[8.0][ADD] social_media_pinterest addon (#118)

pull/209/head
Pere Albujer 7 years ago
committed by Holger Brunn
parent
commit
294e22a269
  1. 84
      social_media_pinterest/README.rst
  2. 4
      social_media_pinterest/__init__.py
  3. 21
      social_media_pinterest/__openerp__.py
  4. 5
      social_media_pinterest/models/__init__.py
  5. 12
      social_media_pinterest/models/res_config.py
  6. 11
      social_media_pinterest/models/website.py
  7. BIN
      social_media_pinterest/static/description/icon.png
  8. 29
      social_media_pinterest/static/description/index.html
  9. BIN
      social_media_pinterest/static/description/pinterest.png
  10. BIN
      social_media_pinterest/static/description/settings.png
  11. 28
      social_media_pinterest/views/res_config.xml
  12. 19
      social_media_pinterest/views/website_templates.xml
  13. 24
      social_media_pinterest/views/website_views.xml
  14. 84
      social_media_pinterest_blog/README.rst
  15. 3
      social_media_pinterest_blog/__init__.py
  16. 21
      social_media_pinterest_blog/__openerp__.py
  17. BIN
      social_media_pinterest_blog/static/description/icon.png
  18. 29
      social_media_pinterest_blog/static/description/index.html
  19. BIN
      social_media_pinterest_blog/static/description/pinterest.png
  20. BIN
      social_media_pinterest_blog/static/description/settings.png
  21. 20
      social_media_pinterest_blog/views/website_blog_template.xml

84
social_media_pinterest/README.rst

@ -0,0 +1,84 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
Pinterest Social Media Icon Extension for blog
==============
This module adds Pinterest social media icon. By default, the icon will
be shown on the footer and about us, like the original icons.
Configuration
=============
- Go in the backend under settings / website
- You can now also add your Pinterest Account
Usage
=====
- Normal social icons::
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
<a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
- The new social icons:
<a t-att-href="website.social_pinterest" t-if="website.social_pinterest"><i class="fa fa-pinterest"/></a>
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/205/8.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/social/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Pinterest: `Brand guidelines <https://business.pinterest.com/en/brand-guidelines\#brand-basics>`_ `Icons <https://business.pinterest.com/sites/business/files/pinterest_badge.zip>`_.
Contributors
------------
* Pere Albujer (pedro.albujer.rico@diagram.es)
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

4
social_media_pinterest/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import models

21
social_media_pinterest/__openerp__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Pinterest Social Media Icon Extension",
'summary': """Pinterest Extension for the social media icons from the
odoo core""",
'author': "Diagram Software S.L., Odoo Community Association (OCA)",
'website': "http://www.diagram.es",
'license': 'AGPL-3',
'category': 'Social Media',
'version': '8.0.1.0.0',
'depends': [
'website',
],
'data': [
'views/website_templates.xml',
'views/website_views.xml',
'views/res_config.xml',
],
}

5
social_media_pinterest/models/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import res_config
from . import website

12
social_media_pinterest/models/res_config.py

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models
class WebsiteConfigSettings(models.TransientModel):
_inherit = 'website.config.settings'
social_pinterest = fields.Char('Pinterest Account',
related='website_id.social_pinterest')

11
social_media_pinterest/models/website.py

@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, models
class Website(models.Model):
_inherit = 'website'
social_pinterest = fields.Char('Pinterest Account')

BIN
social_media_pinterest/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

29
social_media_pinterest/static/description/index.html

@ -0,0 +1,29 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h3 class="oe_slogan">
Social Media Icon Extention for
</h3>
</div>
<div class="oe_span12">
<div>
<a href="https://pinterest.com/">
<img class="oe_picture"
style="margin: 0 auto"
src="pinterest.png">
</a>
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
Extend Social Media Links
</p>
</div>
<div class="oe_span12">
<div>
<img class="oe_picture"
src="settings.png">
</div>
</div>
</div>
</section>

BIN
social_media_pinterest/static/description/pinterest.png

After

Width: 145  |  Height: 144  |  Size: 4.8 KiB

BIN
social_media_pinterest/static/description/settings.png

After

Width: 726  |  Height: 266  |  Size: 26 KiB

28
social_media_pinterest/views/res_config.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_website_config_settings_ext"
model="ir.ui.view">
<field name="name">Website settings</field>
<field name="model">website.config.settings</field>
<field name="inherit_id" ref="website.view_website_config_settings"/>
<field name="arch"
type="xml">
<xpath expr="//div[@name='social_googleplus']"
position="after">
<label for="social_pinterest"/>
<div name="social_pinterest">
<div class="oe_inline">
<field name="social_pinterest"
placeholder="https://pinterest.com"/>
</div>
</div>
</xpath>
</field>
</record>
</data>
</openerp>

19
social_media_pinterest/views/website_templates.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="footer_default_extra"
inherit_id="website.footer_default">
<xpath expr="//a[6]"
position="after">
<a t-att-href="website.social_pinterest"
t-if="website.social_pinterest">
<i class="fa fa-pinterest"/>
</a>
</xpath>
</template>
</data>
</openerp>

24
social_media_pinterest/views/website_views.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_website_form_extra"
model="ir.ui.view">
<field name="name">website.form</field>
<field name="model">website</field>
<field name="inherit_id"
ref="website.view_website_form"/>
<field name="arch"
type="xml">
<field name="social_github"
position="after">
<field name="social_pinterest"
placeholder="http://pinterest.com"/>
</field>
</field>
</record>
</data>
</openerp>

84
social_media_pinterest_blog/README.rst

@ -0,0 +1,84 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
Pinterest Social Media Icon Extension
==============
This module adds Pinterest social media icon. By default, the icon will
be shown on the footer, about us, and the Blog, like the original icons.
Configuration
=============
- Go in the backend under settings / website
- You can now also add your Pinterest Account
Usage
=====
- Normal social icons::
<a t-att-href="website.social_facebook" t-if="website.social_facebook"><i class="fa fa-facebook-square"/></a>
<a t-att-href="website.social_twitter" t-if="website.social_twitter"><i class="fa fa-twitter"/></a>
<a t-att-href="website.social_linkedin" t-if="website.social_linkedin"><i class="fa fa-linkedin"/></a>
<a t-att-href="website.social_youtube" t-if="website.social_youtube"><i class="fa fa-youtube-play"/></a>
<a t-att-href="website.social_googleplus" t-if="website.social_googleplus"><i class="fa fa-google-plus-square"/></a>
<a t-att-href="website.social_github" t-if="website.social_github"><i class="fa fa-github"/></a>
- The new social icons:
<a t-att-href="website.social_pinterest" t-if="website.social_pinterest"><i class="fa fa-pinterest"/></a>
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/205/8.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/social/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Pinterest: `Brand guidelines <https://business.pinterest.com/en/brand-guidelines\#brand-basics>`_ `Icons <https://business.pinterest.com/sites/business/files/pinterest_badge.zip>`_.
Contributors
------------
* Pere Albujer (pedro.albujer.rico@diagram.es)
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

3
social_media_pinterest_blog/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

21
social_media_pinterest_blog/__openerp__.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# © 2016 Diagram Software S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': "Pinterest Social Media Icon Extension for blog",
'summary': """Pinterest Extension for the social media icons from the
odoo core""",
'author': "Diagram Software S.L., Odoo Community Association (OCA)",
'website': "http://www.diagram.es",
'license': 'AGPL-3',
'category': 'Social Media',
'version': '8.0.1.0.0',
'depends': [
'social_media_pinterest',
'website',
'website_blog'
],
'data': [
'views/website_blog_template.xml',
],
}

BIN
social_media_pinterest_blog/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

29
social_media_pinterest_blog/static/description/index.html

@ -0,0 +1,29 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h3 class="oe_slogan">
Social Media Icon Extention for
</h3>
</div>
<div class="oe_span12">
<div>
<a href="https://pinterest.com/">
<img class="oe_picture"
style="margin: 0 auto"
src="pinterest.png">
</a>
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
Extend Social Media Links
</p>
</div>
<div class="oe_span12">
<div>
<img class="oe_picture"
src="settings.png">
</div>
</div>
</div>
</section>

BIN
social_media_pinterest_blog/static/description/pinterest.png

After

Width: 145  |  Height: 144  |  Size: 4.8 KiB

BIN
social_media_pinterest_blog/static/description/settings.png

After

Width: 726  |  Height: 266  |  Size: 26 KiB

20
social_media_pinterest_blog/views/website_blog_template.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="opt_blog_rc_follow_us_extra"
name="Extra Social Links"
inherit_id="website_blog.opt_blog_rc_follow_us">
<xpath expr="//h2[@class='mt4']"
position="inside">
<a t-att-href="website.social_pinterest"
t-if="website.social_pinterest">
<i class="fa fa-pinterest"/>
</a>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save