Skip to content
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
113 changes: 113 additions & 0 deletions web_editor_class_selector/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
Web editor class selector
=========================

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

.. |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/license-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/19.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-19-0/web-19-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=19.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:%2019.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

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Carlos Lopez

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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-carlos-lopez-tecnativa| image:: https://github.com/carlos-lopez-tecnativa.png?size=40px
:target: https://github.com/carlos-lopez-tecnativa
:alt: carlos-lopez-tecnativa

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-carlos-lopez-tecnativa|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/19.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
31 changes: 31 additions & 0 deletions web_editor_class_selector/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Web editor class selector",
"version": "19.0.1.0.0",
"summary": "",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": [
"html_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/css_selector/**/*",
"web_editor_class_selector/static/src/scss/demo_styles.scss",
"web_editor_class_selector/static/src/js/fields/**/*",
"web_editor_class_selector/static/src/js/utils/**/*",
"web_editor_class_selector/static/src/js/wysiwyg/**/*",
],
},
"maintainers": ["carlos-lopez-tecnativa"],
"installable": True,
"auto_install": False,
"license": "AGPL-3",
}
15 changes: 15 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,15 @@
<?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>
116 changes: 116 additions & 0 deletions web_editor_class_selector/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# 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: 2025-02-20 11:07+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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
#, 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__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:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__sequence
msgid "Sequence"
msgstr "Sequenza"

#. 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"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
107 changes: 107 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,107 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_editor_class_selector
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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/css_selector/css_selector_plugin.esm.js:0
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__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:ir.model.fields,field_description:web_editor_class_selector.field_web_editor_class__sequence
msgid "Sequence"
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
Loading