diff --git a/mail_preview_audio/README.rst b/mail_preview_audio/README.rst new file mode 100644 index 000000000..07fb8fba8 --- /dev/null +++ b/mail_preview_audio/README.rst @@ -0,0 +1,76 @@ +=================== +Preview audio files +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsocial-lightgray.png?logo=github + :target: https://github.com/OCA/social/tree/15.0/mail_preview_audio + :alt: OCA/social +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_preview_audio + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/205/15.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to preview audio files. + +**Table of contents** + +.. contents:: + :local: + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Creu Blanca + +Contributors +~~~~~~~~~~~~ + +* Enric Tobella + +* `Tecnativa `_: + * David Vidal + +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. + +This module is part of the `OCA/social `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mail_preview_audio/__init__.py b/mail_preview_audio/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/mail_preview_audio/__manifest__.py b/mail_preview_audio/__manifest__.py new file mode 100644 index 000000000..600bc94f0 --- /dev/null +++ b/mail_preview_audio/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2020 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Preview audio files", + "summary": "Allow to preview audio files", + "version": "15.0.1.0.0", + "license": "AGPL-3", + "author": "Creu Blanca,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/social", + "depends": ["mail_preview_base"], + "data": [], + "qweb": ["static/src/xml/preview.xml"], + "assets": { + "web.assets_backend": ["mail_preview_audio/static/src/js/*.js"], + "web.assets_qweb": ["mail_preview_audio/static/src/xml/*.xml"], + }, +} diff --git a/mail_preview_audio/i18n/mail_preview_audio.pot b/mail_preview_audio/i18n/mail_preview_audio.pot new file mode 100644 index 000000000..26d31c6a0 --- /dev/null +++ b/mail_preview_audio/i18n/mail_preview_audio.pot @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_preview_audio +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_preview_audio +#. openerp-web +#: code:addons/mail_preview_audio/static/src/xml/preview.xml:0 +#: code:addons/mail_preview_audio/static/src/xml/preview.xml:0 +#, python-format +msgid "Audio" +msgstr "" diff --git a/mail_preview_audio/readme/CONTRIBUTORS.rst b/mail_preview_audio/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..5d1721f23 --- /dev/null +++ b/mail_preview_audio/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Enric Tobella + +* `Tecnativa `_: + * David Vidal diff --git a/mail_preview_audio/readme/DESCRIPTION.rst b/mail_preview_audio/readme/DESCRIPTION.rst new file mode 100644 index 000000000..e7dd1ed4f --- /dev/null +++ b/mail_preview_audio/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to preview audio files. diff --git a/mail_preview_audio/static/description/icon.png b/mail_preview_audio/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mail_preview_audio/static/description/icon.png differ diff --git a/mail_preview_audio/static/description/index.html b/mail_preview_audio/static/description/index.html new file mode 100644 index 000000000..931f10aea --- /dev/null +++ b/mail_preview_audio/static/description/index.html @@ -0,0 +1,421 @@ + + + + + + +Preview audio files + + + +
+

Preview audio files

+ + +

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runbot

+

This module allows to preview audio files.

+

Table of contents

+ +
+

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 smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/social project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mail_preview_audio/static/src/js/preview.esm.js b/mail_preview_audio/static/src/js/preview.esm.js new file mode 100644 index 000000000..e06fda321 --- /dev/null +++ b/mail_preview_audio/static/src/js/preview.esm.js @@ -0,0 +1,19 @@ +/** @odoo-module **/ +/* Copyright 2020 Creu Blanca + * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).*/ + +import {DocumentViewer} from "mail_preview_base.preview"; + +DocumentViewer.include({ + _checkAttachment: function (attachment) { + if (attachment.type !== "url" && attachment.mimetype.match("audio")) { + attachment.type = "audio"; + attachment.source_url = this._getImageUrl(attachment); + return true; + } + return this._super(...arguments); + }, + _hasPreview: function (type) { + return this._super(...arguments) || type === "audio"; + }, +}); diff --git a/mail_preview_audio/static/src/xml/preview.xml b/mail_preview_audio/static/src/xml/preview.xml new file mode 100644 index 000000000..0922964e1 --- /dev/null +++ b/mail_preview_audio/static/src/xml/preview.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/setup/mail_preview_audio/odoo/addons/mail_preview_audio b/setup/mail_preview_audio/odoo/addons/mail_preview_audio new file mode 120000 index 000000000..7e2195be3 --- /dev/null +++ b/setup/mail_preview_audio/odoo/addons/mail_preview_audio @@ -0,0 +1 @@ +../../../../mail_preview_audio \ No newline at end of file diff --git a/setup/mail_preview_audio/setup.py b/setup/mail_preview_audio/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/mail_preview_audio/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)