Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] web_editor_class_selector: Migration to version 17.0 #2991

Open
wants to merge 5 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions web_editor_class_selector/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
=========================
Web editor class selector
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:87a4e58b89ecc7f911d8e9fad84c60f0b1a024d6564c5040550651ed2be7ff83
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/17.0/web_editor_class_selector
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_editor_class_selector
: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/web&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows users to create custom CSS class records, which can
then be selected and applied directly in the HTML editor. Note: The
actual CSS file containing the class definitions is not provided by this
module and must be loaded in a custom module.

**Table of contents**

.. contents::
:local:

Usage
=====

- Go to Settings > Technical > User Interface > Web editor Class.
- Create and name your custom CSS classes.
- Go to any model with an HTML field (e.g., Settings > Users >
Preferences > Signature).
- In the HTML editor, select any content block.
- Choose from the available CSS classes to apply the desired styling.

Known issues / Roadmap
======================

Add support to apply class to any element (currently, only span is
supported)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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 <https://github.com/OCA/web/issues/new?body=module:%20web_editor_class_selector%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Tecnativa

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/web <https://github.com/OCA/web/tree/17.0/web_editor_class_selector>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions web_editor_class_selector/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
32 changes: 32 additions & 0 deletions web_editor_class_selector/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Web editor class selector",
"version": "17.0.1.0.0",
"summary": "",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": [
"web_editor",
],
"data": [
"security/ir.model.access.csv",
"views/web_editor_class_views.xml",
"views/menus.xml",
],
"demo": [
"demo/web_editor_class_demo.xml",
],
"assets": {
"web.assets_backend": [
"web_editor_class_selector/static/src/js/backend/**/*",
],
"web_editor.backend_assets_wysiwyg": [
"web_editor_class_selector/static/src/js/odoo-editor/**/*",
"web_editor_class_selector/static/src/js/wysiwyg/**/*",
"web_editor_class_selector/static/src/scss/demo_styles.scss",
"web_editor_class_selector/static/src/xml/**/",
],
},
"installable": True,
"auto_install": False,
"license": "AGPL-3",
}
17 changes: 17 additions & 0 deletions web_editor_class_selector/demo/web_editor_class_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="class_button" model="web.editor.class">
<field name="name">Button</field>
<field name="class_name">demo_button</field>
</record>
<record id="class_menu" model="web.editor.class">
<field name="name">Menu</field>
<field name="class_name">demo_menu</field>
</record>
<record id="class_field" model="web.editor.class">
<field name="name">Field</field>
<field name="class_name">demo_field</field>
</record>

</odoo>
114 changes: 114 additions & 0 deletions web_editor_class_selector/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_editor_class_selector
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-10-07 10:06+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__active
msgid "Active"
msgstr "Attiva"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__class_name
msgid "Class Name"
msgstr "Nome classe"

#. module: web_editor_class_selector
#: model:ir.model.constraint,message:web_editor_class_selector.constraint_web_editor_class_class_name_uniq
msgid "Class name must be unique"
msgstr "Il nome della classe deve essere univoco"

#. module: web_editor_class_selector
#: model_terms:ir.actions.act_window,help:web_editor_class_selector.action_web_editor_class
msgid "Click here to add new Web Editor Class."
msgstr "Fare clic qui per aggiungere una nuova classe editor web."

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_uid
msgid "Created by"
msgstr "Creato da"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_date
msgid "Created on"
msgstr "Creato il"

#. module: web_editor_class_selector
#. odoo-javascript
#: code:addons/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js:0
#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0
#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0
#, python-format
msgid "Custom CSS"
msgstr "CSS personalizzato"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__id
msgid "ID"
msgstr "ID"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__name
msgid "Name"
msgstr "Nome"

#. module: web_editor_class_selector
#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form
msgid "Name..."
msgstr "Nome..."

#. module: web_editor_class_selector
#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form
msgid "Some CSS class"
msgstr "Qualche classe CSS"

#. module: web_editor_class_selector
#: model:ir.model.fields,help:web_editor_class_selector.field_web_editor_class__class_name
msgid ""
"The class name to be added to the tag. It must be created in the CSS file."
msgstr ""
"Il nome della classe da aggiungere al tag. Deve essere creata nel file CSS."

#. module: web_editor_class_selector
#: model:ir.actions.act_window,name:web_editor_class_selector.action_web_editor_class
#: model:ir.ui.menu,name:web_editor_class_selector.web_editor_class_menu
msgid "Web Editor Class"
msgstr "Classe editor web"

#. module: web_editor_class_selector
#: model:ir.model,name:web_editor_class_selector.model_web_editor_class
msgid "Web editor class selector"
msgstr "Selettore classe editore web"
110 changes: 110 additions & 0 deletions web_editor_class_selector/i18n/web_editor_class_selector.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_editor_class_selector
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__active
msgid "Active"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__class_name
msgid "Class Name"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.constraint,message:web_editor_class_selector.constraint_web_editor_class_class_name_uniq
msgid "Class name must be unique"
msgstr ""

#. module: web_editor_class_selector
#: model_terms:ir.actions.act_window,help:web_editor_class_selector.action_web_editor_class
msgid "Click here to add new Web Editor Class."
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_uid
msgid "Created by"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__create_date
msgid "Created on"
msgstr ""

#. module: web_editor_class_selector
#. odoo-javascript
#: code:addons/web_editor_class_selector/static/src/js/odoo-editor/OdooEditor.esm.js:0
#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0
#: code:addons/web_editor_class_selector/static/src/xml/web_editor.xml:0
#, python-format
msgid "Custom CSS"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__display_name
msgid "Display Name"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__id
msgid "ID"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class____last_update
msgid "Last Modified on"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_uid
msgid "Last Updated by"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__write_date
msgid "Last Updated on"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__name
msgid "Name"
msgstr ""

#. module: web_editor_class_selector
#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form
msgid "Name..."
msgstr ""

#. module: web_editor_class_selector
#: model_terms:ir.ui.view,arch_db:web_editor_class_selector.view_web_editor_class_form
msgid "Some CSS class"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model.fields,help:web_editor_class_selector.field_web_editor_class__class_name
msgid ""
"The class name to be added to the tag. It must be created in the CSS file."
msgstr ""

#. module: web_editor_class_selector
#: model:ir.actions.act_window,name:web_editor_class_selector.action_web_editor_class
#: model:ir.ui.menu,name:web_editor_class_selector.web_editor_class_menu
msgid "Web Editor Class"
msgstr ""

#. module: web_editor_class_selector
#: model:ir.model,name:web_editor_class_selector.model_web_editor_class
msgid "Web editor class selector"
msgstr ""
1 change: 1 addition & 0 deletions web_editor_class_selector/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import web_editor_class
18 changes: 18 additions & 0 deletions web_editor_class_selector/models/web_editor_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import fields, models


class WebEditorClass(models.Model):
_name = "web.editor.class"
_description = "Web editor class selector"

name = fields.Char(required=True)
class_name = fields.Char(
required=True,
help="The class name to be added to the tag. "
"It must be created in the CSS file.",
)
active = fields.Boolean(default=True)

_sql_constraints = [
("class_name_uniq", "unique(class_name)", "Class name must be unique")
]
3 changes: 3 additions & 0 deletions web_editor_class_selector/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions web_editor_class_selector/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module allows users to create custom CSS class records, which can
then be selected and applied directly in the HTML editor. Note: The
actual CSS file containing the class definitions is not provided by this
module and must be loaded in a custom module.
Loading
Loading