diff --git a/web_widget_classes/README.rst b/web_widget_classes/README.rst new file mode 100644 index 00000000..c766818e --- /dev/null +++ b/web_widget_classes/README.rst @@ -0,0 +1,37 @@ +CSS classes for widgets +======================= + +For simple UI changes, having classes attached to widgets giving +information about the model being displayed can be essential. + +For instance, to apply some CSS to the name field in forms for tasks, + +:: + + .oe_model_project_task input[name='name'] + { + //your CSS + } + +will be enough. + +Credits +======= + +Contributors +------------ + +* Holger Brunn + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_widget_classes/__init__.py b/web_widget_classes/__init__.py new file mode 100644 index 00000000..f6974117 --- /dev/null +++ b/web_widget_classes/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_widget_classes/__openerp__.py b/web_widget_classes/__openerp__.py new file mode 100644 index 00000000..926e2571 --- /dev/null +++ b/web_widget_classes/__openerp__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "CSS classes for widgets", + "version": "1.0", + "author": "Therp BV", + "complexity": "normal", + "summary": "Allows small UI changes with simple CSS", + "category": "Dependency", + "depends": [ + 'web', + ], + "qweb": [ + 'static/src/xml/web_widget_classes.xml', + ], + "auto_install": False, + "installable": True, +} diff --git a/web_widget_classes/static/description/icon.png b/web_widget_classes/static/description/icon.png new file mode 100644 index 00000000..f1006195 Binary files /dev/null and b/web_widget_classes/static/description/icon.png differ diff --git a/web_widget_classes/static/src/xml/web_widget_classes.xml b/web_widget_classes/static/src/xml/web_widget_classes.xml new file mode 100644 index 00000000..c57879e6 --- /dev/null +++ b/web_widget_classes/static/src/xml/web_widget_classes.xml @@ -0,0 +1,9 @@ + + + + + this.attr('t-att-class', '"' + this.attr('class') + ' oe_model_" + (widget.dataset.model.replace(new RegExp("\\\\.","g"), "_"))'); + this.attr('class', null); + + +