[IMP] web_editor, *: add a generic class for large editor widgets
*: website, website_payment, website_sale Instead of having a "o_we_large_input" class, now to have large widget, we can use the generic "o_we_large" class (a future update is needing that for a non- input widget). task-2431285 X-original-commit: a8446e5d0f0b10f99f8174c012a6a53e2134b77a Part-of: odoo/odoo#77255
This commit is contained in:
@@ -1168,7 +1168,7 @@ const InputUserValueWidget = UnitUserValueWidget.extend({
|
||||
unitEl.textContent = unit;
|
||||
this.containerEl.appendChild(unitEl);
|
||||
if (unit.length > 3) {
|
||||
this.el.classList.add('o_we_large_input');
|
||||
this.el.classList.add('o_we_large');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1706,7 +1706,7 @@ const DatetimePickerUserValueWidget = InputUserValueWidget.extend({
|
||||
await this._super(...arguments);
|
||||
|
||||
const datetimePickerId = _.uniqueId('datetimepicker');
|
||||
this.el.classList.add('o_we_large_input');
|
||||
this.el.classList.add('o_we_large');
|
||||
this.inputEl.classList.add('datetimepicker-input', 'mx-0', 'text-left');
|
||||
this.inputEl.setAttribute('id', datetimePickerId);
|
||||
this.inputEl.setAttribute('data-target', '#' + datetimePickerId);
|
||||
@@ -2412,7 +2412,7 @@ const Many2oneUserValueWidget = SelectUserValueWidget.extend({
|
||||
|
||||
if (this.options.createMethod) {
|
||||
this.createInput = new InputUserValueWidget(this, undefined, {
|
||||
classes: ['o_we_large_input'],
|
||||
classes: ['o_we_large'],
|
||||
dataAttributes: { noPreview: 'true' },
|
||||
}, this.$target);
|
||||
this.createButton = new ButtonUserValueWidget(this, undefined, {
|
||||
|
||||
@@ -862,6 +862,14 @@ body.editor_enable.editor_has_snippets {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Keep only the first class in master
|
||||
.o_we_large, .o_we_large_input {
|
||||
> div {
|
||||
flex: 1 1 auto !important;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons
|
||||
we-button.o_we_user_value_widget {
|
||||
> div {
|
||||
@@ -1148,9 +1156,6 @@ body.editor_enable.editor_has_snippets {
|
||||
flex: 0 1 auto;
|
||||
width: $o-we-sidebar-content-field-input-max-width;
|
||||
}
|
||||
&.o_we_large_input > div {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
input {
|
||||
flex: 1 1 auto;
|
||||
width: 0;
|
||||
|
||||
@@ -418,11 +418,11 @@
|
||||
</div>
|
||||
|
||||
<div data-selector="img">
|
||||
<we-input string="Description" class="o_we_large_input"
|
||||
<we-input string="Description" class="o_we_large"
|
||||
data-select-attribute="" data-attribute-name="alt"
|
||||
placeholder="Alt tag"
|
||||
title="'Alt tag' specifies an alternate text for an image, if the image cannot be displayed (slow connection, missing image, screen reader ...)."/>
|
||||
<we-input string="Tooltip" class="o_we_large_input"
|
||||
<we-input string="Tooltip" class="o_we_large"
|
||||
data-select-attribute="" data-attribute-name="title"
|
||||
placeholder="Title tag"
|
||||
title="'Title tag' is shown as a tooltip when you hover the picture."/>
|
||||
|
||||
@@ -39,7 +39,7 @@ const UrlPickerUserValueWidget = InputUserValueWidget.extend({
|
||||
linkButton.title = _t("Redirect to URL in a new tab");
|
||||
linkButton.appendChild(icon);
|
||||
this.containerEl.appendChild(linkButton);
|
||||
this.el.classList.add('o_we_large_input');
|
||||
this.el.classList.add('o_we_large');
|
||||
this.inputEl.classList.add('text-left');
|
||||
const options = {
|
||||
position: {
|
||||
@@ -284,7 +284,7 @@ const GPSPicker = InputUserValueWidget.extend({
|
||||
*/
|
||||
async start() {
|
||||
await this._super(...arguments);
|
||||
this.el.classList.add('o_we_large_input');
|
||||
this.el.classList.add('o_we_large');
|
||||
if (!this._gmapLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -659,7 +659,7 @@ options.registry.WebsiteFormEditor = FormEditor.extend({
|
||||
inputEl.dataset.fieldName = field.name;
|
||||
inputEl.dataset.addActionField = '';
|
||||
inputEl.setAttribute('string', field.string);
|
||||
inputEl.classList.add('o_we_large_input');
|
||||
inputEl.classList.add('o_we_large');
|
||||
return inputEl;
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<template id="s_facebook_page_options" inherit_id="website.snippet_options">
|
||||
<xpath expr="." position="inside">
|
||||
<div string="Page URL" data-js="facebookPage" data-selector=".o_facebook_page">
|
||||
<we-input class="o_we_large_input" data-page-url="https://www.facebook.com/Odoo" data-no-preview="true"/>
|
||||
<we-input class="o_we_large" data-page-url="https://www.facebook.com/Odoo" data-no-preview="true"/>
|
||||
<we-checkbox string="Cover Photo" data-option-name="show_cover" data-toggle-option="true" data-no-preview="true"/>
|
||||
<we-checkbox string="Timeline" data-option-name="tab.timeline" data-toggle-option="true" data-no-preview="true"/>
|
||||
<we-checkbox string="Events" data-option-name="tab.events" data-toggle-option="true" data-no-preview="true"/>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<template id="s_map_options" inherit_id="website.snippet_options">
|
||||
<xpath expr="//div[@data-js='Box']" position="before">
|
||||
<div data-js="Map" data-selector=".s_map">
|
||||
<we-input class="o_we_large_input" string="Address" data-select-data-attribute="" data-no-preview="true" data-attribute-name="mapAddress" placeholder="e.g. De Brouckere, Brussels, Belgium"/>
|
||||
<we-input class="o_we_large" string="Address" data-select-data-attribute="" data-no-preview="true" data-attribute-name="mapAddress" placeholder="e.g. De Brouckere, Brussels, Belgium"/>
|
||||
<we-select string="Type" data-no-preview="true" data-attribute-name="mapType">
|
||||
<we-button data-select-data-attribute="m">Road</we-button>
|
||||
<we-button data-select-data-attribute="k">Satellite</we-button>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<t t-set="unit_textarea_height">rows</t>
|
||||
<we-input string="⌙ Height" data-step="1" t-attf-data-select-attribute="3#{unit_textarea_height}" t-att-data-unit="unit_textarea_height"
|
||||
data-attribute-name="rows" data-apply-to="textarea"/>
|
||||
<we-input string="Label" class="o_we_large_input" data-set-label-text=""/>
|
||||
<we-input string="Label" class="o_we_large" data-set-label-text=""/>
|
||||
<we-button-group string="⌙ Position">
|
||||
<we-button title="Hide"
|
||||
data-select-label-position="none">
|
||||
@@ -116,16 +116,16 @@
|
||||
data-img="/website/static/src/img/snippets_options/pos_right.svg"/>
|
||||
</we-button-group>
|
||||
<we-checkbox string="Description" data-toggle-description="true" data-no-preview="true"/>
|
||||
<we-input string="Placeholder" class="o_we_large_input"
|
||||
<we-input string="Placeholder" class="o_we_large"
|
||||
data-select-attribute="" data-attribute-name="placeholder"
|
||||
data-apply-to="input[type='text'], input[type='email'], input[type='number'], input[type='tel'], input[type='url'], textarea"/>
|
||||
<t t-set="default_value_label">Default Value</t>
|
||||
<we-input t-att-string="default_value_label" class="o_we_large_input" data-select-textarea-value="" data-apply-to="textarea"/>
|
||||
<we-input t-att-string="default_value_label" class="o_we_large" data-select-textarea-value="" data-apply-to="textarea"/>
|
||||
<we-checkbox t-att-string="default_value_label" data-select-attribute="checked" data-attribute-name="checked"
|
||||
data-apply-to=".col-sm > * > input[type='checkbox']" data-no-preview="true"/>
|
||||
<we-input t-att-string="default_value_label" class="o_we_large_input" data-select-attribute="" data-attribute-name="value" data-select-property=""
|
||||
<we-input t-att-string="default_value_label" class="o_we_large" data-select-attribute="" data-attribute-name="value" data-select-property=""
|
||||
data-property-name="value" data-apply-to="input[type='text']:not(.datetimepicker-input), input[type='email'], input[type='tel'], input[type='url']"/>
|
||||
<we-input t-att-string="default_value_label" class="o_we_large_input" data-select-attribute="" data-attribute-name="value" data-select-property=""
|
||||
<we-input t-att-string="default_value_label" class="o_we_large" data-select-attribute="" data-attribute-name="value" data-select-property=""
|
||||
data-step="1" data-property-name="value" data-apply-to="input[type='number']"/>
|
||||
<we-datetimepicker t-att-string="default_value_label" data-select-attribute="" data-attribute-name="value" data-select-value-property=""
|
||||
data-apply-to=".s_website_form_datetime input"/>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<template id="s_donation_options" inherit_id="website.snippet_options">
|
||||
<xpath expr="." position="inside">
|
||||
<div data-js="Donation" data-selector=".s_donation">
|
||||
<we-input class="o_we_large_input" string="Recipient Email" data-select-data-attribute=""
|
||||
<we-input class="o_we_large" string="Recipient Email" data-select-data-attribute=""
|
||||
data-attribute-name="donationEmail"/>
|
||||
<we-checkbox string="Display Options"
|
||||
data-name="display_options_opt"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<we-button data-select-data-attribute="all">All Products</we-button>
|
||||
<we-button data-select-data-attribute="current">Current Category or All</we-button>
|
||||
</we-select>
|
||||
<we-input string="Product names" class="o_we_large_input" data-name="product_names_opt"
|
||||
<we-input string="Product names" class="o_we_large" data-name="product_names_opt"
|
||||
data-attribute-name="productNames" data-no-preview="true" data-select-data-attribute=""
|
||||
placeholder="e.g. lamp,bin" title="Comma-separated list of parts of product names"/>
|
||||
</t>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</we-row>
|
||||
<div class="d-none" data-name="ribbon_customize_opt">
|
||||
<we-row string="Ribbon">
|
||||
<we-input data-set-ribbon-html="" class="o_we_large_input" data-apply-to=".o_wsale_ribbon_dummy"/>
|
||||
<we-input data-set-ribbon-html="" class="o_we_large" data-apply-to=".o_wsale_ribbon_dummy"/>
|
||||
<we-button class="fa fa-check" data-save-ribbon="" title="Validate" data-no-preview="true"/>
|
||||
<we-button class="fa fa-trash" data-delete-ribbon="" title="Delete" data-no-preview="true"/>
|
||||
</we-row>
|
||||
|
||||
Reference in New Issue
Block a user