diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-04-19 18:06:12 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-05-04 12:07:30 +0200 |
| commit | 250e716c3a12e88acb4a199b427dc47d4ec55d5d (patch) | |
| tree | 0be849fd0af8d54f556af5f1274e641200ec82ef /addons/web/static/src/less/form_view_extra.less | |
| parent | 8943aae665ea906aa03bc30cada884c571738b7c (diff) | |
[REF] web, *: restore views design
Since the new views merge, a lot of design elements were broken. This
was particularly impacting the fields in the editable list view; indeed
the editable list view is not using an inline form view anymore so the
fields in the list were not properly styled as the LESS was still
defined assuming the form view environment (for example the invalid
fields were red for o2m fields in form view but not in editable list
view even though they got the right CSS class).
This commit refactor the LESS following these rules:
- No more division of non-layout and layout rules. Dividing LESS rules
in x_layout.less and x.less was a mistake. Many rules can be
considered to be layout and not layout at the same time, developers
always have to switch from one file part to the other, many CSS
selectors (and rules!) are duplicated for nothing, ...
- Field style is extracted from x_view.less and put in the new
fields.less file. As before, the fields_extra.less will contain the
rules specific to community so that the enterprise repo can override
those by replacing the whole file.
- Many classes have been renamed so that o_form_x_y becomes o_x_y as
many classes can now be applied outside of form view. These classes
should not be used in templates anyway.
The commit also changes the DOM of fields so that it is more minimalist
(no useless parent div, etc).
Input elements are not automatically styled anymore, they have to get
the o_input class explicitely. This allows to fix lots of small style
bugs of previous versions (required monetary field had not the proper
style, readonly m2m tags appeared as editable, ...). This also improves
the LESS code.
The editable list view should also completely stop flickering on chrome
and firefox.
The commit also removes the orange outline on list view dirty cells.
The commit also removes deprecated static xml, LESS and other code.
Notice there are still styles to restore/fix and LESS to improve.
Diffstat (limited to 'addons/web/static/src/less/form_view_extra.less')
| -rw-r--r-- | addons/web/static/src/less/form_view_extra.less | 145 |
1 files changed, 91 insertions, 54 deletions
diff --git a/addons/web/static/src/less/form_view_extra.less b/addons/web/static/src/less/form_view_extra.less index 710b668c053..6e48c173c6e 100644 --- a/addons/web/static/src/less/form_view_extra.less +++ b/addons/web/static/src/less/form_view_extra.less @@ -1,10 +1,30 @@ +@sheet-max-width: 860px; +@sheet-min-width: 650px; +@sheet-padding: 16px; + .o_form_view { .o_form_sheet_bg { - background: url(/web/static/src/img/form_sheetbg.png); + position: relative; + padding: @sheet-padding 0; border-bottom: 1px solid #ddd; + background: url(/web/static/src/img/form_sheetbg.png); + .o_form_sheet { + min-width: @sheet-min-width; + max-width: @sheet-max-width; + min-height: 330px; + margin: 0 auto; + padding: 16px; border: 1px solid #c8c8d3; box-shadow: 0 4px 20px rgba(0,0,0,0.15); + background: white; + + .ui-tabs { + margin: 0 -16px; + } + .oe_notebook_page { + padding: 0 16px; + } } } @@ -16,26 +36,59 @@ .btn-default; } } - &.o_form_nosheet > header { - margin: -16px -16px 0 -16px; + &.o_form_nosheet { + padding: 16px; + &.oe_form_nomargin { + margin: 0; + } + > header { + margin: -16px -16px 0 -16px; + } } // Button box .oe_button_box { + width: 400px; + text-align: right; + float: right; + + &, & + .oe_avatar { + + .oe_title { + width: 400px; + } + } + .oe_stat_button { + text-align: left; + width: 132px !important; + height: 40px; + margin: 0px -1px -1px 0px; + padding: 0; border-radius: 0; border-color: #ccc; background: white; outline: none; + &:hover { background-color: #e6e6e6; } + .o_button_icon { + display: inline-block; + width: 37px; + padding: 0px 3px; + text-align: center; + vertical-align: middle; color: #7C7BAD; font-size: 24px; } - .o_stat_info { // contains the value and text + // Some buttons only display text and directly use the WidgetButton template instead of StatInfo + .o_stat_info, > span { // contains the value and text + display: inline-block; + max-width: 70%; + line-height: 1.2; + .o_stat_value { .o-text-overflow(block); font-weight: 700; @@ -50,19 +103,34 @@ } } } - - // Some buttons only display text and directly use the WidgetButton template instead of StatInfo > span { font-size: small; white-space: normal; // text on several lines if needed } + + > div { + text-align: left; + padding: 0; + line-height: 120%; + vertical-align: middle; + } } } // Avatar - .oe_avatar > img { - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); - border: none; + .oe_avatar { + float: left; + > img { + max-height: 90px; + max-width: 90px; + margin-bottom: 10px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); + border: none; + } + + .oe_title { + padding-left: 95px; + margin-left: 5px; + } } // Groups @@ -70,31 +138,15 @@ .o_td_label { border-right: 1px solid #ddd; } - } - - // All required form fields - .o_form_required { - &.o_form_input, .o_form_input, &.o_form_textarea, .o_form_textarea { - background-color: #D2D2FF; + .o_td_label + td { + padding: 2px 36px 2px 8px; } - } - - .o_form_field.o_form_field_many2one .o_external_button { - padding: 0; - margin-left: 2px; - font-size: 19px; - color: #7C7BAD; - border: none; - &:hover { - background-color: transparent; + .o_field_widget.o_text_overflow { + width: 1px!important; // hack to make the table layout believe it is a small element (so that the table does not grow too much) ... + min-width: 100%; // ... but in fact it takes the whole table space } } - // Dropdowns input carret - .o_form_input_dropdown .o_dropdown_button { - .o-position-absolute(2px, 4px); - } - // Separators .o_horizontal_separator { color: @odoo-brand-optional; @@ -106,30 +158,6 @@ margin-left: -15px; } - // Percent pie field - .o_form_field_percent_pie { - @pie-dimension: 34px; - @pie-ring-width: 4px; - - .o_pie { - width: @pie-dimension; - height: @pie-dimension; - margin-left: 5px; - - &:after { // Outside pie border to go over border-radius irregularities - border: 1px solid @odoo-brand-primary; - } - - .o_pie_value { - .o-position-absolute(@pie-ring-width, @pie-ring-width); - width: @pie-dimension - 2 * @pie-ring-width; - height: @pie-dimension - 2 * @pie-ring-width; - border: 1px solid white; - background-color: white; - } - } - } - // Specific style classes .o_group.o_inner_group.oe_subtotal_footer { .oe_subtotal_footer_separator { @@ -139,6 +167,15 @@ border-right: none; } } + + // Chatter + .oe_chatter { + display: block; + min-width: @sheet-min-width + 2* @sheet-padding; + max-width: @sheet-max-width + 2* @sheet-padding; + margin: 0 auto; + padding: 16px 16px 48px; + } } // Overriden style when form view in modal |
