From 7f783fc8f64ea627b57204d94e025aa91d7217ab Mon Sep 17 00:00:00 2001 From: Anjeel Haria Date: Thu, 3 Jul 2025 17:43:02 +0530 Subject: [PATCH] [IMP] attachment_preview: pre-commit auto fixes --- attachment_preview/README.rst | 49 ++++++++++--------- attachment_preview/pyproject.toml | 3 ++ attachment_preview/readme/CONTRIBUTORS.md | 2 + attachment_preview/readme/CONTRIBUTORS.rst | 2 - attachment_preview/readme/CREDITS.md | 3 ++ attachment_preview/readme/CREDITS.rst | 4 -- attachment_preview/readme/DESCRIPTION.md | 6 +++ attachment_preview/readme/DESCRIPTION.rst | 7 --- .../readme/{INSTALL.rst => INSTALL.md} | 2 +- attachment_preview/readme/USAGE.md | 8 +++ attachment_preview/readme/USAGE.rst | 8 --- .../static/description/index.html | 34 +++++++------ .../static/src/xml/attachment_preview.xml | 18 ++++--- 13 files changed, 80 insertions(+), 66 deletions(-) create mode 100644 attachment_preview/pyproject.toml create mode 100644 attachment_preview/readme/CONTRIBUTORS.md delete mode 100644 attachment_preview/readme/CONTRIBUTORS.rst create mode 100644 attachment_preview/readme/CREDITS.md delete mode 100644 attachment_preview/readme/CREDITS.rst create mode 100644 attachment_preview/readme/DESCRIPTION.md delete mode 100644 attachment_preview/readme/DESCRIPTION.rst rename attachment_preview/readme/{INSTALL.rst => INSTALL.md} (85%) create mode 100644 attachment_preview/readme/USAGE.md delete mode 100644 attachment_preview/readme/USAGE.rst diff --git a/attachment_preview/README.rst b/attachment_preview/README.rst index 5ed5ac83..84c46f5b 100644 --- a/attachment_preview/README.rst +++ b/attachment_preview/README.rst @@ -17,24 +17,25 @@ Preview attachments :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github - :target: https://github.com/OCA/knowledge/tree/15.0/attachment_preview + :target: https://github.com/OCA/knowledge/tree/18.0/attachment_preview :alt: OCA/knowledge .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-attachment_preview + :target: https://translation.odoo-community.org/projects/knowledge-18-0/knowledge-18-0-attachment_preview :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/knowledge&target_branch=15.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This addon allows to preview attachments supported by http://viewerjs.org. +This addon allows to preview attachments supported by +http://viewerjs.org. Currently, that's most Libreoffice files and PDFs. -.. image:: https://raw.githubusercontent.com/attachment_preview/static/description/screenshot-split.png - :alt: Screenshot of split form view - :width: 100% +|Screenshot of split form view| + +.. |Screenshot of split form view| image:: https://raw.githubusercontent.com/attachment_preview/static/description/screenshot-split.png **Table of contents** @@ -53,13 +54,15 @@ Usage ===== The module adds a little print preview icon right of download links for -attachments or binary fields. When a preview is opened from the attachments -menu it's shown next to the form view. From this screen you can navigate -through the attachments using the arrow buttons. Using the pop-out button -next to the navigational buttons you can open the preview in a separate window. +attachments or binary fields. When a preview is opened from the +attachments menu it's shown next to the form view. From this screen you +can navigate through the attachments using the arrow buttons. Using the +pop-out button next to the navigational buttons you can open the preview +in a separate window. -.. image:: https://raw.githubusercontent.com/attachment_preview/static/description/screenshot-paginator.png - :alt: Screenshot navigator +|Screenshot navigator| + +.. |Screenshot navigator| image:: https://raw.githubusercontent.com/attachment_preview/static/description/screenshot-paginator.png Bug Tracker =========== @@ -67,7 +70,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -75,27 +78,27 @@ Credits ======= Authors -~~~~~~~ +------- * Therp BV * Onestein Contributors -~~~~~~~~~~~~ +------------ -* Holger Brunn -* Dennis Sluijk +- Holger Brunn +- Dennis Sluijk Other credits -~~~~~~~~~~~~~ +------------- Addon icon ----------- +~~~~~~~~~~ -* courtesy of http://commons.wikimedia.org/wiki/Crystal_Clear +- courtesy of http://commons.wikimedia.org/wiki/Crystal_Clear Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -107,6 +110,6 @@ 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/knowledge `_ project on GitHub. +This module is part of the `OCA/knowledge `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attachment_preview/pyproject.toml b/attachment_preview/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/attachment_preview/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/attachment_preview/readme/CONTRIBUTORS.md b/attachment_preview/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..85e13507 --- /dev/null +++ b/attachment_preview/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Holger Brunn \<\> +- Dennis Sluijk \<\> diff --git a/attachment_preview/readme/CONTRIBUTORS.rst b/attachment_preview/readme/CONTRIBUTORS.rst deleted file mode 100644 index da0e7b99..00000000 --- a/attachment_preview/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Holger Brunn -* Dennis Sluijk diff --git a/attachment_preview/readme/CREDITS.md b/attachment_preview/readme/CREDITS.md new file mode 100644 index 00000000..3931e95d --- /dev/null +++ b/attachment_preview/readme/CREDITS.md @@ -0,0 +1,3 @@ +## Addon icon + +- courtesy of diff --git a/attachment_preview/readme/CREDITS.rst b/attachment_preview/readme/CREDITS.rst deleted file mode 100644 index 07bb3a4e..00000000 --- a/attachment_preview/readme/CREDITS.rst +++ /dev/null @@ -1,4 +0,0 @@ -Addon icon ----------- - -* courtesy of http://commons.wikimedia.org/wiki/Crystal_Clear diff --git a/attachment_preview/readme/DESCRIPTION.md b/attachment_preview/readme/DESCRIPTION.md new file mode 100644 index 00000000..603b408f --- /dev/null +++ b/attachment_preview/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This addon allows to preview attachments supported by +. + +Currently, that's most Libreoffice files and PDFs. + +![Screenshot of split form view](/attachment_preview/static/description/screenshot-split.png) diff --git a/attachment_preview/readme/DESCRIPTION.rst b/attachment_preview/readme/DESCRIPTION.rst deleted file mode 100644 index aadfd944..00000000 --- a/attachment_preview/readme/DESCRIPTION.rst +++ /dev/null @@ -1,7 +0,0 @@ -This addon allows to preview attachments supported by http://viewerjs.org. - -Currently, that's most Libreoffice files and PDFs. - -.. image:: /attachment_preview/static/description/screenshot-split.png - :alt: Screenshot of split form view - :width: 100% diff --git a/attachment_preview/readme/INSTALL.rst b/attachment_preview/readme/INSTALL.md similarity index 85% rename from attachment_preview/readme/INSTALL.rst rename to attachment_preview/readme/INSTALL.md index eb26fced..01f9a5f1 100644 --- a/attachment_preview/readme/INSTALL.rst +++ b/attachment_preview/readme/INSTALL.md @@ -1,4 +1,4 @@ For filetype recognition, you'll get the best results by installing -``python-magic``: +`python-magic`: sudo apt-get install python-magic diff --git a/attachment_preview/readme/USAGE.md b/attachment_preview/readme/USAGE.md new file mode 100644 index 00000000..f9c7d703 --- /dev/null +++ b/attachment_preview/readme/USAGE.md @@ -0,0 +1,8 @@ +The module adds a little print preview icon right of download links for +attachments or binary fields. When a preview is opened from the +attachments menu it's shown next to the form view. From this screen you +can navigate through the attachments using the arrow buttons. Using the +pop-out button next to the navigational buttons you can open the preview +in a separate window. + +![Screenshot navigator](/attachment_preview/static/description/screenshot-paginator.png) diff --git a/attachment_preview/readme/USAGE.rst b/attachment_preview/readme/USAGE.rst deleted file mode 100644 index 941a680c..00000000 --- a/attachment_preview/readme/USAGE.rst +++ /dev/null @@ -1,8 +0,0 @@ -The module adds a little print preview icon right of download links for -attachments or binary fields. When a preview is opened from the attachments -menu it's shown next to the form view. From this screen you can navigate -through the attachments using the arrow buttons. Using the pop-out button -next to the navigational buttons you can open the preview in a separate window. - -.. image:: /attachment_preview/static/description/screenshot-paginator.png - :alt: Screenshot navigator diff --git a/attachment_preview/static/description/index.html b/attachment_preview/static/description/index.html index a614260a..438db718 100644 --- a/attachment_preview/static/description/index.html +++ b/attachment_preview/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,10 +369,11 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:573f74622167c92c4eb0881999cde8d69bb3de4a4b7489a1703158d3a66a8269 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runboat

-

This addon allows to preview attachments supported by http://viewerjs.org.

+

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runboat

+

This addon allows to preview attachments supported by +http://viewerjs.org.

Currently, that’s most Libreoffice files and PDFs.

-Screenshot of split form view +

Screenshot of split form view

Table of contents

    @@ -400,18 +401,19 @@ ul.auto-toc {

    Usage

    The module adds a little print preview icon right of download links for -attachments or binary fields. When a preview is opened from the attachments -menu it’s shown next to the form view. From this screen you can navigate -through the attachments using the arrow buttons. Using the pop-out button -next to the navigational buttons you can open the preview in a separate window.

    -Screenshot navigator +attachments or binary fields. When a preview is opened from the +attachments menu it’s shown next to the form view. From this screen you +can navigate through the attachments using the arrow buttons. Using the +pop-out button next to the navigational buttons you can open the preview +in a separate window.

    +

    Screenshot navigator

    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.

    +feedback.

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

    @@ -442,11 +444,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +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/knowledge project on GitHub.

    +

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

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

    diff --git a/attachment_preview/static/src/xml/attachment_preview.xml b/attachment_preview/static/src/xml/attachment_preview.xml index 92c2094e..a52f9a38 100644 --- a/attachment_preview/static/src/xml/attachment_preview.xml +++ b/attachment_preview/static/src/xml/attachment_preview.xml @@ -50,20 +50,26 @@
    + > + + - +
    + > + + + > + +