Merge lp:~therp-nl/web-addons/6.1-web_widget_classes into lp:~webaddons-core-editors/web-addons/6.1

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 24
Proposed branch: lp:~therp-nl/web-addons/6.1-web_widget_classes
Merge into: lp:~webaddons-core-editors/web-addons/6.1
Diff against target: 109 lines (+88/-0)
3 files modified
web_widget_classes/__init__.py (+20/-0)
web_widget_classes/__openerp__.py (+59/-0)
web_widget_classes/static/src/xml/web_widget_classes.xml (+9/-0)
To merge this branch: bzr merge lp:~therp-nl/web-addons/6.1-web_widget_classes
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review Approve
Guewen Baconnier @ Camptocamp code review Approve
Pedro Manuel Baeza Abstain
Review via email: mp+198703@code.launchpad.net

Description of the change

This addon adds the form widget's model to the classes. This way we can do a lot of simple UI customizations with CSS.

The plan would be to do the same for the other view widgets, and provide a 7.0 version where necessary.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Holger, I don't know too much about web client development, but I'm seeing some strange things in this MP: if it's for 6.1 version, I'm seeing on the manifest file keys values that correspond to v7 (data, auto_install, qweb, etc). Why is this?

Regards.

review: Needs Information
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Hi Pedro,

thanks for your comment. The keys are caused by my new_addon script, that writes all this stuff for me... Not really a good reason, but I'm not aware that unknown keys do any harm, are you?

But concerning the keys you mention: 'data' is used in 6.1 too and treated like 'update_xml', 'qweb' was also used in 6.1 already (otherwise, the whole plugin would be pretty pointless) and 'active' actually is an alias of 'auto_install': http://bazaar.launchpad.net/~ocb/ocb-server/6.1/view/head:/openerp/modules/module.py#L324

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

OK, sorry for my ignorance.

I'm going to abstain and let others to make the review, due to I don't know about this area.

Regards

review: Abstain
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

s/dislpayed/displayed/

Do I understand well if I say that it will append the classes of the <table> elements of the widget a CSS class with the name of the model, example: oe_model_res_partner.

Could you give such an example in the __openerp__ manifest?

Thanks!

review: Needs Information
25. By Holger Brunn (Therp)

[FIX] typo
[IMP] add an example to description

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Thanks Guewen!

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks!

review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'web_widget_classes'
=== added file 'web_widget_classes/__init__.py'
--- web_widget_classes/__init__.py 1970-01-01 00:00:00 +0000
+++ web_widget_classes/__init__.py 2014-01-02 09:54:39 +0000
@@ -0,0 +1,20 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
021
=== added file 'web_widget_classes/__openerp__.py'
--- web_widget_classes/__openerp__.py 1970-01-01 00:00:00 +0000
+++ web_widget_classes/__openerp__.py 2014-01-02 09:54:39 +0000
@@ -0,0 +1,59 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{
22 "name" : "CSS classes for widgets",
23 "version" : "1.0",
24 "author" : "Therp BV",
25 "complexity": "normal",
26 "description": """
27 For simple UI changes, having classes attached to widgets giving
28 information about the model being displayed can be essential.
29
30 For instance, to apply some CSS to the name field in forms for tasks,
31
32 ::
33
34 .oe_model_project_task input[name='name']
35 {
36 //your CSS
37 }
38
39 will be enough.
40 """,
41 "category" : "Dependency",
42 "depends" : [
43 'web',
44 ],
45 "data" : [
46 ],
47 "js": [
48 ],
49 "css": [
50 ],
51 "qweb": [
52 'static/src/xml/web_widget_classes.xml',
53 ],
54 "auto_install": False,
55 "installable": True,
56 "external_dependencies" : {
57 'python' : [],
58 },
59}
060
=== added directory 'web_widget_classes/static'
=== added directory 'web_widget_classes/static/src'
=== added directory 'web_widget_classes/static/src/img'
=== added file 'web_widget_classes/static/src/img/icon.png'
1Binary files web_widget_classes/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_widget_classes/static/src/img/icon.png 2014-01-02 09:54:39 +0000 differ61Binary files web_widget_classes/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_widget_classes/static/src/img/icon.png 2014-01-02 09:54:39 +0000 differ
=== added directory 'web_widget_classes/static/src/xml'
=== added file 'web_widget_classes/static/src/xml/web_widget_classes.xml'
--- web_widget_classes/static/src/xml/web_widget_classes.xml 1970-01-01 00:00:00 +0000
+++ web_widget_classes/static/src/xml/web_widget_classes.xml 2014-01-02 09:54:39 +0000
@@ -0,0 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<templates id="template">
3 <t t-extend="WidgetFrame">
4 <t t-jquery="table">
5 this.attr('t-att-class', '"' + this.attr('class') + ' oe_model_" + (widget.view.dataset.model.replace(new RegExp("\\\\.","g"), "_"))');
6 this.attr('class', null);
7 </t>
8 </t>
9</templates>

Subscribers

People subscribed via source and target branches