diff --git a/website_company_mastodon_link/README.rst b/website_company_mastodon_link/README.rst new file mode 100644 index 0000000000..ad5aad2624 --- /dev/null +++ b/website_company_mastodon_link/README.rst @@ -0,0 +1,97 @@ +=============================== +Website - Company Mastodon Link +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e734ac518bf3febed981e3bdafae77abd3dce4afad703b2857fd069cc618ff23 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github + :target: https://github.com/OCA/website/tree/18.0/website_company_mastodon_link + :alt: OCA/website +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_company_mastodon_link + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds Company Mastodon links on websites. + +|website| + +.. |website| image:: https://raw.githubusercontent.com/OCA/website/18.0/website_company_mastodon_link/static/description/img/website.png + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +- For unknown reason, if you make a change in the footer of the website, + the mastodon icon is duplicated, and has to be removed manually. + +- Change website form view to put ``social_mastodon`` field in 'Social + Media' page, once https://github.com/odoo/odoo/pull/237668 is merged. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* GRAP + +Contributors +------------ + +- Sylvain LE GAL + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainer `__: + +|maintainer-legalsylvain| + +This module is part of the `OCA/website `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_company_mastodon_link/__init__.py b/website_company_mastodon_link/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/website_company_mastodon_link/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_company_mastodon_link/__manifest__.py b/website_company_mastodon_link/__manifest__.py new file mode 100644 index 0000000000..fc589911f2 --- /dev/null +++ b/website_company_mastodon_link/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2025 - Today: GRAP https://www.grap.coop +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Website - Company Mastodon Link", + "summary": "Display Company Mastodon Link" " on Website", + "version": "18.0.1.0.0", + "author": "GRAP, Odoo Community Association (OCA)", + "maintainers": ["legalsylvain"], + "website": "https://github.com/OCA/website", + "license": "AGPL-3", + "category": "Website", + "depends": ["website", "res_company_mastodon_link", "base_fontawesome"], + "data": [ + "templates/website_templates.xml", + "templates/s_social_media.xml", + "templates/s_mega_menu_odoo_menu.xml", + "views/view_website.xml", + ], +} diff --git a/website_company_mastodon_link/i18n/fr.po b/website_company_mastodon_link/i18n/fr.po new file mode 100644 index 0000000000..e4fe935d39 --- /dev/null +++ b/website_company_mastodon_link/i18n/fr.po @@ -0,0 +1,25 @@ +#. module: website_company_mastodon_link +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.footer_custom +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.header_social_links +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.s_mega_menu_odoo_menu +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.s_social_media +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.template_footer_centered +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.template_footer_headline +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.template_footer_links +msgid "Mastodon" +msgstr "" + +#. module: website_company_mastodon_link +#: model:ir.model.fields,field_description:website_company_mastodon_link.field_website__social_mastodon +msgid "Mastodon Account" +msgstr "Compte Mastodon" + +#. module: website_company_mastodon_link +#: model_terms:ir.ui.view,arch_db:website_company_mastodon_link.view_website_form +msgid "Social Media" +msgstr "Réseaux sociaux" + +#. module: website_company_mastodon_link +#: model:ir.model,name:website_company_mastodon_link.model_website +msgid "Website" +msgstr "Site Web" diff --git a/website_company_mastodon_link/models/__init__.py b/website_company_mastodon_link/models/__init__.py new file mode 100644 index 0000000000..bd190fa80b --- /dev/null +++ b/website_company_mastodon_link/models/__init__.py @@ -0,0 +1 @@ +from . import website diff --git a/website_company_mastodon_link/models/website.py b/website_company_mastodon_link/models/website.py new file mode 100644 index 0000000000..869aaeaad6 --- /dev/null +++ b/website_company_mastodon_link/models/website.py @@ -0,0 +1,15 @@ +# Copyright 2025 - Today: GRAP https://www.grap.coop +# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo import fields, models + + +class Website(models.Model): + _inherit = "website" + + social_mastodon = fields.Char( + "Mastodon Account", default=lambda x: x._default_social_mastodon() + ) + + def _default_social_mastodon(self): + return self.env.ref("base.main_company").social_mastodon diff --git a/website_company_mastodon_link/pyproject.toml b/website_company_mastodon_link/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_company_mastodon_link/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_company_mastodon_link/readme/CONTRIBUTORS.md b/website_company_mastodon_link/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..3442186d90 --- /dev/null +++ b/website_company_mastodon_link/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Sylvain LE GAL \<\> diff --git a/website_company_mastodon_link/readme/DESCRIPTION.md b/website_company_mastodon_link/readme/DESCRIPTION.md new file mode 100644 index 0000000000..a4398ae271 --- /dev/null +++ b/website_company_mastodon_link/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adds Company Mastodon links on websites. + +![website](../static/description/img/website.png) diff --git a/website_company_mastodon_link/readme/ROADMAP.md b/website_company_mastodon_link/readme/ROADMAP.md new file mode 100644 index 0000000000..d92b897439 --- /dev/null +++ b/website_company_mastodon_link/readme/ROADMAP.md @@ -0,0 +1,6 @@ +* For unknown reason, if you make a change in the footer of the website, + the mastodon icon is duplicated, and has to be removed manually. + +* Change website form view to put `social_mastodon` field in 'Social Media' + page, once https://github.com/odoo/odoo/pull/237668 is merged. + \ No newline at end of file diff --git a/website_company_mastodon_link/static/description/index.html b/website_company_mastodon_link/static/description/index.html new file mode 100644 index 0000000000..8711293314 --- /dev/null +++ b/website_company_mastodon_link/static/description/index.html @@ -0,0 +1,436 @@ + + + + + +Website - Company Mastodon Link + + + + + + diff --git a/website_company_mastodon_link/static/description/website.png b/website_company_mastodon_link/static/description/website.png new file mode 100644 index 0000000000..d77b18569b Binary files /dev/null and b/website_company_mastodon_link/static/description/website.png differ diff --git a/website_company_mastodon_link/templates/s_mega_menu_odoo_menu.xml b/website_company_mastodon_link/templates/s_mega_menu_odoo_menu.xml new file mode 100644 index 0000000000..06591cea02 --- /dev/null +++ b/website_company_mastodon_link/templates/s_mega_menu_odoo_menu.xml @@ -0,0 +1,15 @@ + + + + diff --git a/website_company_mastodon_link/templates/s_social_media.xml b/website_company_mastodon_link/templates/s_social_media.xml new file mode 100644 index 0000000000..166f5e1291 --- /dev/null +++ b/website_company_mastodon_link/templates/s_social_media.xml @@ -0,0 +1,15 @@ + + + + diff --git a/website_company_mastodon_link/templates/website_templates.xml b/website_company_mastodon_link/templates/website_templates.xml new file mode 100644 index 0000000000..c5c8ca59b2 --- /dev/null +++ b/website_company_mastodon_link/templates/website_templates.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_company_mastodon_link/views/view_website.xml b/website_company_mastodon_link/views/view_website.xml new file mode 100644 index 0000000000..505a9a9635 --- /dev/null +++ b/website_company_mastodon_link/views/view_website.xml @@ -0,0 +1,20 @@ + + + + website + + + + + + + + + + + +