diff --git a/mail_preview_audio/README.rst b/mail_preview_audio/README.rst new file mode 100644 index 000000000..855f54a9d --- /dev/null +++ b/mail_preview_audio/README.rst @@ -0,0 +1,73 @@ +=================== +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/12.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-12-0/social-12-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/12.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 + +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..ab232300b --- /dev/null +++ b/mail_preview_audio/__manifest__.py @@ -0,0 +1,19 @@ +# 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': '12.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': [ + "template/assets.xml" + ], + 'qweb': ['static/src/xml/preview.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..9af393dfc --- /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 12.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:7 +#, 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..93ec993e0 --- /dev/null +++ b/mail_preview_audio/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Enric Tobella 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..8b8532fb7 --- /dev/null +++ b/mail_preview_audio/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +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.js b/mail_preview_audio/static/src/js/preview.js new file mode 100644 index 000000000..334c2ceca --- /dev/null +++ b/mail_preview_audio/static/src/js/preview.js @@ -0,0 +1,29 @@ +/** ******************************************************************************** + Copyright 2020 Creu Blanca + License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + **********************************************************************************/ + +odoo.define("audio_file.preview", function(require) { + "use strict"; + + var DocumentViewer = require("mail.DocumentViewer"); + + 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.apply(this, arguments); + }, + _hasPreview: function (type) { + var result = this._super.apply(this, arguments); + return result || 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..2732c6092 --- /dev/null +++ b/mail_preview_audio/static/src/xml/preview.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/mail_preview_audio/template/assets.xml b/mail_preview_audio/template/assets.xml new file mode 100644 index 000000000..74b87a200 --- /dev/null +++ b/mail_preview_audio/template/assets.xml @@ -0,0 +1,14 @@ + + + +