summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-07-17 10:59:07 +0200
committerDavid Monjoie <dmo@odoo.com>2015-08-06 10:14:27 +0200
commit441449673adbdd1d20e156fe89510e2d05c114c3 (patch)
tree0e7000ffd96c270a32e5aba27503c1ee3df511af /addons
parentf6a246045f0d1dd05b36409c3c0101c52e091d67 (diff)
[IMP] web: classnames update for new design compatibility
The DOM structure and elements's classnames diverge in community and enterprise editions. Tips must work perfectly with both editions, obviously. This rev. updates some classnames in the community edition for the tips's selectors to match in both editions. The following classnames have been renamed/introduced: - oe_form_buttons_view renamed to o_form_buttons_view - oe_form_buttons_edit renamed to o_form_buttons_edit - oe_form_invisible renamed to o_form_invisible - oe_list now also has classname o_list_view - header tag in form views now has classname o_form_statusbar_buttons Other changes like these might be required later if other tips are introduced...
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/css/base.css6
-rw-r--r--addons/web/static/src/css/base.sass4
-rw-r--r--addons/web/static/src/js/views/form_common.js6
-rw-r--r--addons/web/static/src/js/views/form_view.js11
-rw-r--r--addons/web/static/src/js/views/list_view.js2
-rw-r--r--addons/web/static/src/xml/base.xml4
6 files changed, 18 insertions, 15 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 83489fcba3c..49f87a4dbd0 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -1098,10 +1098,10 @@
.openerp .oe-control-panel .oe_form_buttons {
padding: 0;
}
-.openerp .oe-control-panel .oe_form_buttons_view > button {
+.openerp .oe-control-panel .o_form_buttons_view > button {
float: left;
}
-.openerp .oe-control-panel .oe_form_buttons_view > button:last-child {
+.openerp .oe-control-panel .o_form_buttons_view > button:last-child {
float: right;
margin-left: 4px;
}
@@ -1574,7 +1574,7 @@
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset;
}
-.openerp .oe_form_invisible {
+.openerp .o_form_invisible {
display: none !important;
}
.openerp .oe_form_editable .oe_read_only {
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 2c9807b8c03..a83d7d5a020 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -948,7 +948,7 @@ $sheet-padding: 16px
width: 100%
.oe_form_buttons
padding: 0
- .oe_form_buttons_view
+ .o_form_buttons_view
> button
float: left
&:last-child
@@ -1322,7 +1322,7 @@ $sheet-padding: 16px
button.oe_highlight:hover
@include vertical-gradient(#f6f6f6, #e3e3e3)
@include box-shadow((0 1px 2px rgba(0, 0, 0, .1), 0 1px 1px rgba(255, 255, 255, .8) inset))
- .oe_form_invisible
+ .o_form_invisible
display: none !important
.oe_form_editable
.oe_read_only
diff --git a/addons/web/static/src/js/views/form_common.js b/addons/web/static/src/js/views/form_common.js
index e1798034844..9752fb057fe 100644
--- a/addons/web/static/src/js/views/form_common.js
+++ b/addons/web/static/src/js/views/form_common.js
@@ -333,7 +333,7 @@ var InvisibilityChangerMixin = {
this._check_visibility();
},
_check_visibility: function() {
- this.$el.toggleClass('oe_form_invisible', this.get("effective_invisible"));
+ this.$el.toggleClass('o_form_invisible', this.get("effective_invisible"));
},
};
@@ -362,7 +362,7 @@ var NotebookInvisibilityChanger = InvisibilityChanger.extend({
// Remove this element as active and set a visible sibling active (if there is one)
if (this.$el.hasClass('active')) {
this.$el.removeClass('active');
- var visible_siblings = this.$el.siblings(':not(.oe_form_invisible)');
+ var visible_siblings = this.$el.siblings(':not(.o_form_invisible)');
if (visible_siblings.length) {
$(visible_siblings[0]).addClass('active');
}
@@ -372,7 +372,7 @@ var NotebookInvisibilityChanger = InvisibilityChanger.extend({
// If there is no visible active sibling, set this element as active,
// otherwise if that sibling hasn't autofocus and if we are in edit mode,
// remove that sibling as active and set this element as active
- var visible_active_sibling = this.$el.siblings(':not(.oe_form_invisible).active');
+ var visible_active_sibling = this.$el.siblings(':not(.o_form_invisible).active');
if (!(visible_active_sibling.length)) {
this.$el.addClass('active');
} else if (!$(visible_active_sibling[0]).data('autofocus') && this._ic_field_manager.get('actual_mode') === "edit") {
diff --git a/addons/web/static/src/js/views/form_view.js b/addons/web/static/src/js/views/form_view.js
index 6ad21c1dcff..304232d0bc4 100644
--- a/addons/web/static/src/js/views/form_view.js
+++ b/addons/web/static/src/js/views/form_view.js
@@ -152,7 +152,7 @@ var FormView = View.extend(common.FieldManagerMixin, {
//bounce effect on red button when click on statusbar.
this.$el.find(".oe_form_field_status:not(.oe_form_status_clickable)").on('click', function (e) {
if((self.get("actual_mode") == "view")) {
- var $button = self.$el.find(".oe_highlight:not(.oe_form_invisible)").css({'float':'left','clear':'none'});
+ var $button = self.$el.find(".oe_highlight:not(.o_form_invisible)").css({'float':'left','clear':'none'});
$button.openerpBounce();
e.stopPropagation();
}
@@ -262,8 +262,8 @@ var FormView = View.extend(common.FieldManagerMixin, {
toggle_buttons: function() {
var view_mode = this.get("actual_mode") === "view";
if (this.$buttons) {
- this.$buttons.find('.oe_form_buttons_view').toggle(view_mode);
- this.$buttons.find('.oe_form_buttons_edit').toggle(!view_mode);
+ this.$buttons.find('.o_form_buttons_view').toggle(view_mode);
+ this.$buttons.find('.o_form_buttons_edit').toggle(!view_mode);
}
},
/**
@@ -1357,6 +1357,9 @@ var FormRenderingEngine = FormRenderingEngineInterface.extend({
args[0] = $tag;
return fn.apply(self, args);
} else {
+ if( tagname === 'header') {
+ $tag.addClass('o_statusbar_buttons');
+ }
// generic tag handling, just process children
$tag.children().each(function() {
self.process($(this));
@@ -1605,7 +1608,7 @@ var FormRenderingEngine = FormRenderingEngineInterface.extend({
self.handle_common_properties($content, page.ref, common.NotebookInvisibilityChanger);
});
if (!pageid_to_display) {
- pageid_to_display = $new_notebook.find('div[role="tabpanel"]:not(.oe_form_invisible):first').attr('id');
+ pageid_to_display = $new_notebook.find('div[role="tabpanel"]:not(.o_form_invisible):first').attr('id');
}
// Display page. Note: we can't use bootstrap's show function because it is looking for
diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js
index e7439da3487..4503321953a 100644
--- a/addons/web/static/src/js/views/list_view.js
+++ b/addons/web/static/src/js/views/list_view.js
@@ -175,7 +175,7 @@ var ListView = View.extend( /** @lends instance.web.ListView# */ {
* @returns {$.Deferred} loading promise
*/
start: function() {
- this.$el.addClass('oe_list');
+ this.$el.addClass('oe_list o_list_view');
return this._super();
},
/**
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 7998929a371..3ba802f6ad3 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -468,7 +468,7 @@
</t>
<div t-name="FormView.buttons" class="oe_form_buttons">
<t t-if="widget.options.action_buttons !== false">
- <div class="oe_form_buttons_view">
+ <div class="o_form_buttons_view">
<button t-if="widget.is_action_enabled('edit')"
type="button"
class="oe_form_button_edit btn btn-default btn-sm" accesskey="E">
@@ -480,7 +480,7 @@
Create
</button>
</div>
- <span class="oe_form_buttons_edit">
+ <span class="o_form_buttons_edit">
<button type="button" class="oe_form_button_save btn btn-primary btn-sm" accesskey="S">Save</button>
<span class="oe_fade">or</span>
<a href="#" class="oe_bold oe_form_button_cancel" accesskey="D">Discard</a>