From 950490f792c2b89e83d3558b5e4993d299033a15 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 30 May 2012 23:26:51 +0200 Subject: [PATCH] [FIX] Make most fields inline(-block) instead of block level elements bzr revid: fme@openerp.com-20120530212651-eqzd23mvrjw1bgla --- addons/web/static/src/css/base.css | 56 ++++++--- addons/web/static/src/css/base.sass | 52 +++++--- addons/web/static/src/js/view_form.js | 4 +- addons/web/static/src/js/view_list.js | 2 +- addons/web/static/src/xml/base.xml | 168 ++++++++++---------------- 5 files changed, 145 insertions(+), 137 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index d956cc1c39f..e6c590e3ac6 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1466,6 +1466,7 @@ background: #ed6f6a; } .openerp .oe_form_topbar { + position: relative; border-bottom: 1px solid #cacaca; background-color: #fcfcfc; background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); @@ -1515,6 +1516,11 @@ .openerp .oe_form_topbar ul li a:hover { color: black; } +.openerp .oe_form_topbar .oe_form_steps { + display: inline-block; + position: absolute; + right: 0; +} .openerp .oe_form_topbar .oe_form_steps img { margin: 0 8px; vertical-align: top; @@ -1587,8 +1593,9 @@ .openerp .oe_form .oe_form_group_cell > .oe_form_field_url input, .openerp .oe_form .oe_form_group_cell > .oe_form_field_float input, .openerp .oe_form .oe_form_group_cell > .oe_form_field_selection select, -.openerp .oe_form .oe_form_group_cell > div > .oe_datepicker_root, -.openerp .oe_form .oe_form_group_cell > div > .oe_datepicker_root > input.oe_datepicker_master { +.openerp .oe_form .oe_form_group_cell > .oe_form_field_progressbar, +.openerp .oe_form .oe_form_group_cell > span > .oe_datepicker_root, +.openerp .oe_form .oe_form_group_cell > span > .oe_datepicker_root > input.oe_datepicker_master { width: 100%; } .openerp .oe_form .oe_form_label_help[for], .openerp .oe_form .oe_form_label[for] { @@ -1721,17 +1728,6 @@ background-color: #ff6666 !important; border: 1px solid #dd0000 !important; } -.openerp .oe_form .oe_button.oe_field_button { - display: block; - -webkit-border-top-left-radius: 0px; - -webkit-border-bottom-left-radius: 0px; - -moz-border-radius-topleft: 0px; - -moz-border-radius-bottomleft: 0px; - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; - margin-right: -1px; - height: 22px; -} .openerp .oe_form .oe_input_icon { cursor: pointer; margin: 3px 0 0 -21px; @@ -1748,6 +1744,31 @@ .openerp .oe_form .oe_form_group_cell .oe_kanban_view { position: static; } +.openerp .oe_form .oe_form_field_with_button { + display: inline-block; +} +.openerp .oe_form .oe_form_field_with_button > .oe_button { + float: right; + -webkit-border-top-left-radius: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-topleft: 0px; + -moz-border-radius-bottomleft: 0px; + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + margin-right: -1px; + height: 22px; +} +.openerp .oe_form .oe_form_field_with_button > div { + position: relative; + overflow: hidden; +} +.openerp .oe_form .oe_form_field_with_button > div > input { + line-height: 23px; + margin-right: 0; +} +.openerp .oe_form .oe_form_group_cell .oe_kanban_view { + position: static; +} .openerp .oe_form .oe_form_button.oe_button { height: 22px; color: #4c4c4c; @@ -1786,6 +1807,9 @@ margin: 0; padding: 0; } +.openerp .oe_form .oe_binary_image { + display: inline-block; +} .openerp .oe_horizontal_border { border-bottom: 1px solid black; } @@ -1858,6 +1882,10 @@ .openerp .ui-tabs-hide { display: none; } +.openerp .oe_form .oe_form_field_progressbar { + display: inline-block; + min-width: 70px; +} .openerp .oe_form .oe_form_field_progressbar.ui-progressbar { height: 22px; font-size: 10px; @@ -1999,7 +2027,7 @@ .openerp .oe-listview-content > tbody > tr > td.oe_list_checkbox:first-child:after, .openerp .oe-listview-content > tbody > tr th.oe_list_checkbox:first-child:after { border-width: 0; } -.openerp .oe-listview-content > tbody > tr > td.oe-number { +.openerp .oe-listview-content > tbody > tr > td.oe_number { text-align: right !important; } .openerp .oe-listview-content > tbody > tr:nth-child(odd) { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 7ff1af4743d..4ef576b20a7 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1184,6 +1184,7 @@ $colour4: #8a89ba // }}} // FormView.customdivs {{{ .oe_form_topbar + position: relative border-bottom: 1px solid #cacaca @include vertical-gradient(#fcfcfc, #dedede) padding: 0 8px @@ -1220,10 +1221,13 @@ $colour4: #8a89ba &:hover color: black .oe_form_steps - img + display: inline-block + position: absolute + right: 0 + img margin: 0 8px vertical-align: top - li + li border-right: none padding: 0 &:first-child @@ -1283,8 +1287,9 @@ $colour4: #8a89ba .oe_form_group_cell > .oe_form_field_url input, .oe_form_group_cell > .oe_form_field_float input, .oe_form_group_cell > .oe_form_field_selection select, - .oe_form_group_cell > div > .oe_datepicker_root, - .oe_form_group_cell > div > .oe_datepicker_root > input.oe_datepicker_master + .oe_form_group_cell > .oe_form_field_progressbar, + .oe_form_group_cell > span > .oe_datepicker_root, + .oe_form_group_cell > span > .oe_datepicker_root > input.oe_datepicker_master width: 100% // }}} // FormView.label {{{ @@ -1400,16 +1405,6 @@ $colour4: #8a89ba input, select, textarea background-color: #F66 !important border: 1px solid #D00 !important - .oe_button.oe_field_button - display: block - -webkit-border-top-left-radius: 0px - -webkit-border-bottom-left-radius: 0px - -moz-border-radius-topleft: 0px - -moz-border-radius-bottomleft: 0px - border-top-left-radius: 0px - border-bottom-left-radius: 0px - margin-right: -1px - height: 22px .oe_input_icon cursor: pointer margin: 3px 0 0 -21px @@ -1424,6 +1419,28 @@ $colour4: #8a89ba .oe_form_group_cell .oe_kanban_view // Hack due to absolute positioning of kanban view messing with o2m position: static + .oe_form_field_with_button + display: inline-block + > .oe_button + float: right + -webkit-border-top-left-radius: 0px + -webkit-border-bottom-left-radius: 0px + -moz-border-radius-topleft: 0px + -moz-border-radius-bottomleft: 0px + border-top-left-radius: 0px + border-bottom-left-radius: 0px + margin-right: -1px + height: 22px + > div + position: relative + overflow: hidden + > input + line-height: 23px + margin-right: 0 + + .oe_form_group_cell .oe_kanban_view + // Hack due to absolute positioning of kanban view messing with o2m + position: static // }}} // FormView.buttons {{{ .oe_form @@ -1466,6 +1483,8 @@ $colour4: #8a89ba -ms-filter: "alpha(opacity=0)" margin: 0 padding: 0 + .oe_binary_image + display: inline-block // }}} // FormView.separator {{{ .oe_horizontal_border @@ -1528,6 +1547,9 @@ $colour4: #8a89ba // }}} // FormView.progressbar {{{ .oe_form + .oe_form_field_progressbar + display: inline-block + min-width: 70px .oe_form_field_progressbar.ui-progressbar height: 22px font-size: 10px @@ -1653,7 +1675,7 @@ $colour4: #8a89ba width: 17px &:after border-width: 0 - > td.oe-number + > td.oe_number text-align: right !important > tr:nth-child(odd) background-color: #f0f0fa diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 60bba9879ef..0c19751fc69 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2049,7 +2049,7 @@ instance.web.DateWidget = instance.web.DateTimeWidget.extend({ }); instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(_.extend({}, instance.web.form.ReinitializeFieldMixin, { - template: "EmptyComponent", + tagName: "span", build_widget: function() { return new instance.web.DateTimeWidget(this); }, @@ -4089,7 +4089,7 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ }); instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ - template: "EmptyComponent", + tagName: "span", start: function() { this._super(); this.selected_value = null; diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 67c8ce0239e..081c4444a72 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1338,7 +1338,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we } else if (column.id in group.aggregates) { var r = {}; r[column.id] = {value: group.aggregates[column.id]}; - $('') + $('') .html(instance.web.format_cell( r, column, {process_modifiers: false})) .appendTo($row); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 396bd8e8642..df1d444b491 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -591,7 +591,7 @@ t-if="!field.attrs.modifiers.tree_invisible" t-att-data-id="record.id" t-att-style="color_for(record) + style " - t-attf-class="#{class} #{rank} #{(fields[field.attrs.name].type === 'float') or (fields[field.attrs.name].type === 'integer') ? 'oe-number' : ''}"> + t-attf-class="#{class} #{rank} #{(fields[field.attrs.name].type === 'float') or (fields[field.attrs.name].type === 'integer') ? 'oe_number' : ''}"> @@ -634,7 +634,7 @@ - @@ -679,7 +679,7 @@ @@ -885,71 +885,44 @@ - -
+ + -
-
- - - +
+
- - - - - - -
+ + + + +
-
- -
-
- - - - - + +
+ - - - - - - - -
- - - -
+ + + this.removeClass('oe_form_field_email').addClass('oe_form_field_url'); - - -
- + + @@ -967,7 +940,7 @@ -
+ -
+
- -
- -
-
- - - + + +
- - - - - - -
+ + + + +
- -
- -
-
- - -
- - + + + + +
@@ -1060,26 +1021,23 @@ -
+ -
+
-
-
    - - -
  • - - -
  • -
    -
-
-
+
    + + +
  • + + +
  • +
    +
-
+
@@ -1105,7 +1063,7 @@ Uploading ...