Commit Graph
1864 Commits
Author SHA1 Message Date
stefanorigano (SRI) 0431c49790 [IMP] web_editor: allow 'we-button-group' to increase its size
Allow 'we-button-group' to increase its size when it's the only option
inside an option field.

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) aa69ba54e8 [IMP] web_editor, *: make general adaptations of the editor UI
*: website

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) 5f48af4570 [IMP] web_editor: increase font-size/spacing of the editor UI
11px was set as default font-size when achieving 5 or 6 edition levels
in the sidebar was the norm. Thanks to the snippet's cleanup, resulting
in a reduced number of editable elements, we can now increase the
default fon-size and, consequentially, all general spacings.

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) ab3ebfb96d [IMP] web_editor, *: review 'options' tab specific components design
*: website

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) 4cfe66cebd [IMP] web_editor: review colorpicker selected color visibility
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI)andqsm-odoo fdbcf87228 [IMP] web, web_editor: review colorpicker design
Part of https://github.com/odoo/odoo/pull/55959
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 19:19:47 +00:00
stefanorigano (SRI)andqsm-odoo 95cbf79325 [FIX] web_editor: properly toggle the disabled prop of the "Style" tab
Part of https://github.com/odoo/odoo/pull/55959
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) 93176bf3d7 [REF] web_editor, website: allow reusing tabs design
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
stefanorigano (SRI)andqsm-odoo 5bcdcbceaa [IMP] web_editor, website: review snippets library design
Especially review disabled, hover, install and custom snippet states.

Part of https://github.com/odoo/odoo/pull/55959
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 19:19:47 +00:00
stefanorigano (SRI) f3e3e25938 [IMP] web_editor: review we-customizeblock-options border
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:47 +00:00
qsm-odoo c5fee9d009 [FIX] web_editor, *: restore custom snippets thumbnails
*: website

Since [1], the thumbnails of the saved snippets were not right anymore,
all fallbacking to the default image. This is because snippets thumbs
now use svg files instead of png and the snippet saving feature did not
allow it. This commit fixes that and makes the feature more robust.

- Allow to use any original thumbnail, and not only for website app.
- Remove useless defaut image, a fallback for when the feature is broken
  is useless.
- Identify snippets by key instead of by main class (possible since
  the new `data-snippet` attribute on snippets).

[1]: https://github.com/odoo/odoo/commit/b7fe2bdae2f45372c0d538767a226a413b806f3f

closes odoo/odoo#55896

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-13 15:44:48 +00:00
xO-Txandqsm-odoo 41527531b7 [IMP] web_editor, *: add snippets search filter
*: website

Add a search bar at the top of the "Blocks" tab to filter snippets.

Part of https://github.com/odoo/odoo/pull/55272
task-2309832

closes odoo/odoo#55272

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-13 14:29:20 +00:00
qsm-odoo 8a48e99e19 [IMP] web_editor: prevent removing data-oe attrs of snippets thumbs
Before this commit, all the data-oe-* attributes were removed from
the snippet panel on editor loading. Some were actually added then
removed by the same function... probably for historic reasons. All of
this is now useless, this commit takes also the opportunity to modernize
that all code section and removes other code which was there for
compatibility reasons too.

Now, the data-oe-* on snippets thumbs are kept (as some will actually
be used by upcoming commits). This commit just makes sure no data-oe-*
is left on the snippet bodies themselves.

Part of https://github.com/odoo/odoo/pull/55272
task-2309832
2020-08-13 14:25:06 +00:00
qsm-odoo f563b0c782 [IMP] web_editor: allow min, max and step param on range widget
Part of https://github.com/odoo/odoo/pull/47313
task-46147
2020-08-10 14:27:00 +00:00
qsm-odoo 42e1d4ca60 [IMP] website, *: enable the parallax option for all snippets
*: web_editor, website_blog

Unfortunately, this feature revealed a new batch of flaws in the
editor widgets system so some hacks were made to make it work. We will
always have the time to improve the pure technical side later.

This commit also separates the notion of color filter from the notion
of parallax. A color filter can now be applied independantly, when
there is either a background image or a background video. Applying a
color filter on top of a background video is actually a new feature.
Applying a color filter on top of a background image is actually now
achievable by two different ways: this new color filter layer or by
applying the color transformation on the image itself via the related
option. Depending on the user case, both could make sense at the same
time, but more importantly: having a CSS color filter is useful for
using those for default Odoo content (e.g. like the current contact us
page where we use a cover banner with an image with a black filter on
top of it: doing that without CSS color filter would mean to alter the
image directly which would not be ok when the user changes the image).
Also, sometimes you want the unfiltered image on a page and the exact
same one but filtered on another (for example: forum images).

Note: this commit also "fixes" an issue: the optimization feature for
images when parallax was enabled was not available before.

Part of https://github.com/odoo/odoo/pull/47313
task-46147
2020-08-10 14:27:00 +00:00
stefanorigano (SRI) 9830ee75e0 [IMP] web_editor: restore bootstrap's default monospace font-family
Part of https://github.com/odoo/odoo/pull/55645
task-2157252

closes odoo/odoo#55645

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-07 22:14:22 +00:00
stefanorigano (SRI) 4c6775ee6c [IMP] web_editor: review dropdown design
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:14:22 +00:00
stefanorigano (SRI) b7098ddf2c [IMP] web_editor, website: review color combination preview
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:18 +00:00
stefanorigano (SRI) b8717c5b72 [FIX] web_editor: use border-radius on we-button-group edge buttons only
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:18 +00:00
stefanorigano (SRI) 36a8e2a791 [REF] web_editor, *: allow reusing links and buttons design
*: website

Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:18 +00:00
stefanorigano (SRI) 0838a211fa [FIX] web_editor: fix typos on variable definitions
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
stefanorigano (SRI) eb98420c11 [REM] web_editor: remove <img/> tag support in snippets library
Since v13, snippet's thumbs are rendered as background images using the
't-snippet' instruction.
This code was kept for back-compatibility.

Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
stefanorigano (SRI) bc7d021946 [IMP] web_editor: review range widget dimensions
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
stefanorigano (SRI) 25acf9b176 [IMP] web_editor: change editor panel default font-weight
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
stefanorigano (SRI) a0c324ee7b [IMP] web_editor: reposition snippets' thumbs
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
stefanorigano (SRI) 8d5003db99 [IMP] web_editor: make some color adjustments for editor panel
Part of https://github.com/odoo/odoo/pull/55645
task-2157252
2020-08-07 22:13:17 +00:00
Samuel Degueldre b84e0af742 [IMP] web_editor, website: add background shapes snippet option
This commit adds a new snippet option allowing the user to choose one of
a series of SVG shapes as their background, or to be overlaid over the
background image of a snippet and to customize the colors of those
shapes.

Part of https://github.com/odoo/odoo/pull/53017
task-2210790

closes odoo/odoo#53017

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-07 15:34:45 +00:00
Samuel Degueldre c3dacfea05 [IMP] web_editor, website, *: create background-type toggler option
*: website_blog

Previously, background colors, images, and videos could all be applied
on the same section, such that the image can be used as a fallback for
the video, and the color as a fallback for the image. However, if you
wanted to change the background color behind the background image, the
background image would be removed. The background image and background
video also shared the same widget to pick the image or video.

This commit adds a background-type toggler, where the user can toggle
the background color, image and video individually. It also makes the
video picker into its own UserValueWidget, such that the user can pick
both an image and video without overriding the other.

Part of https://github.com/odoo/odoo/pull/53017
task-2210790
2020-08-07 15:34:45 +00:00
qsm-odoo 5c05592032 [IMP] web_editor: remove check icon for default active buttons
Before this commit, the enabled state of we-button element was a
"pressed-like" background + a check icon. This check icon was then
explicitely removed for we-button extension such as checkboxes and
button groups' buttons. Now, the enabled state does not contains that
check icon by default and it is explicitely added for selects' buttons.

Part of https://github.com/odoo/odoo/pull/53017
task-2210790
2020-08-07 15:15:52 +00:00
Samuel Degueldre 995b20fd6a [REF] web_editor: move normalizeColor function to we-utils for reuse
Part of https://github.com/odoo/odoo/pull/53017
task-2210790
2020-08-07 15:15:52 +00:00
qsm-odoo 201e10b338 [FIX] web_editor: remove useless snippet preview notification
Before this commit, the 'snippet_option_update' event was triggered
whether or not it was a preview update. In the preview update case,
nothing was done, ever. This commit removes the preview notification.
If it ever becomes useful, it can be restored at that moment.

This commit actually solves a bug introduced by [1]: that snippet update
notification is now triggered after a setTimeout delay to allow events
to bubble before the UI update it will trigger (in non preview mode).
The side effect this had was that, between each preview, the execution
chain was deferred of a setTimeout delay between each step (even though
previews do not update the UI). This was enough to allow for a paint
refresh.
So before this commit, if option C was selected, then the user hovered
option A then option B, the option C was visually re-enabled between A
and B. This won't be the case anymore after this commit.

Long story short: restore no-flickering when previewing options.

[1]: https://github.com/odoo/odoo/commit/2616c8950fd615561e720660bcc39e018f4061e4

Part of https://github.com/odoo/odoo/pull/55588

closes odoo/odoo#55588

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-07 08:52:19 +00:00
qsm-odoo 315ba1cfeb [IMP] web_editor, *: simplify UserValueWidget updates
*: website

Before this commit, editor widgets were updated by 3 successive calls
to methods 'setValue', 'updateUI' and '_updateUI'. The last two were
in charge of updating the UI depending of the value that was set, only
in specific condition (like "if the widget is not focused", "or not
previewed", ...).

This is now in fact useless: 'setValue' can be in charge of the UI
update. Indeed, when a value is set on a widget there is no reason to
not update its UI anymore. This was useful when the UI was updated on
preview, which is not the case anymore. This could also be useful for
widget with multiple options attached to them... but in those rare cases
updating the UI multiple times (one time per option method) should not
be a problem.

Part of https://github.com/odoo/odoo/pull/55588
2020-08-07 08:51:23 +00:00
qsm-odoo 6a258db1e9 [IMP] website, *: review the 'options' tab of editor panel
*: web_editor

This will more probably change again in the future but this is a first
step towards a hierarchized 'options' tab for the editor panel.

Part of https://github.com/odoo/odoo/pull/55529
2020-08-06 09:42:48 +00:00
qsm-odoo 90033c95ea [FIX] website: prevent page flickering when modal is opened
Commit [1] introduced a flickering when any modal was opened on the
frontend. Indeed, it introduced the possibility to go into "fullscreen"
mode, which makes the Odoo UI navbar and sidebar disappear. This is
animated: the padding of the `<body/>` element is using a CSS
transition... but when a Bootstrap modal opens, the padding-right is
changed to compensate the scrollbar removal. This change now being
animated, it creates a flickering.

A generic solution was made: only animate what is animated for the
duration of the fullscreen mode switch.

[1]: https://github.com/odoo/odoo/commit/0b0690a3934cedcab0d5e34373e8d40c2ab25660

closes odoo/odoo#55210

X-original-commit: ccadb20c82a651e9ef87e818b898f3e9a081cacd
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-30 14:50:04 +00:00
DramixDwandqsm-odoo bdcc1ea9e7 [IMP] website_blog: add tag from frontend (editor left panel)
Previously, you could only add a tag on a blog post from the backend.
Here we're adding a way to add them from the left-panel so that it's
easier for the user to add them.

The long term goal will not be to reimplement complex view of the
backend. This is actually already past the limit: we will need a way
to instantiate views from the backend in the frontend in the future.

Part of https://github.com/odoo/odoo/pull/52759
task-2267693

closes odoo/odoo#52759

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-31 10:32:22 +00:00
stefanorigano (SRI)andqsm-odoo a1c9044ff7 [IMP] web_editor: render inline svg icons, apply css style
Render inline SVG inside buttons in order to allow CSS styling.

Define SVG icons design for normal/hover status applying the same colors
as default text buttons.

In order to support multi-colors SVGs, this commits will affect inner
shapes in different ways:
- '.o_graphic' shapes: will gets the UI btns colors (default/hover)
- '.o_subdle' shapes: will gets a slightly reduced default text color

Shapes without '.o_graphic/.o_subdle' classes will be rendered normally,
as defined in the svg code.

Part of https://github.com/odoo/odoo/pull/54913
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-30 11:12:03 +00:00
stefanorigano (SRI)andqsm-odoo c0a11148e0 [IMP] web_editor: review snippets thumbs design
Part of https://github.com/odoo/odoo/pull/55089
task-2157252

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-30 10:12:58 +00:00
qsm-odoo 430b5b669f [IMP] website, *: move all google map options to left panel
*: web_editor

-> Introduce the we-gpspicker widget and improve the way the gmap lib
    is loaded (for Odoo / multiple snippets / ...).

Part of https://github.com/odoo/odoo/pull/49101
task-2091396
2020-07-28 07:45:40 +00:00
Nicolas Lempereur fff793f7d7 [FIX] web_editor: carriage return in source mode
Enter keypress browser event were removed in 3c372d1da8.

It was reintroduced in text fields with d2f024d254 and this PR do the
same and reintroduce it for source mode of FieldHtml (`html` widget).

opw-2302605
closes #55066

closes odoo/odoo#55081

X-original-commit: b10ca1f6094b7c8e6e222aa0ea3d1f891e79379a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-07-28 18:16:22 +00:00
6aa6c321a6 [IMP] web: remove min date limitation of year 1900
Before this commit, user could not selecta a date before year 1900.
This was an historical limitation due to python < 3.2 that didn't
support dates before 1900.

After this commit, user can select any date, user can select any
date from 01/01/0001.

taskID: 2166761
Fixes #41788
Closes #43055

closes odoo/odoo#51406

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-07-28 14:02:10 +00:00
Benjamin Vray 4848c3aed7 [FIX] web_editor: fix overlay when scrolling
Since the new effects on the header, the overlays do not overlap
correctly after the page has been scrolled. Now we hide the overlays
during the scrolling and show/recompute it after the scrolling.

Part of https://github.com/odoo/odoo/pull/51446
task-2229127

X-original-commit: 209a94d8c4fcdc2e74860c9392fc14a35aec52ed
2020-07-28 12:20:16 +00:00
qsm-odoo d8e05bd64d [FIX] web_editor: restore custom snippet delete button
Clicking on the delete button of custom snippets was not working anymore
since [1]. Indeed, that button is placed inside the snippet thumbnail
which is the drag handle for the drag and drop feature. Since we now
start the drag as soon as the mouse is mousedown-ed, then the click on
the delete button cannot be intercepted.

This commit solves the problem by placing the delete button out of the
thumbnail element.

[1]: https://github.com/odoo/odoo/commit/ab72fe6c4681f62dc670f1cf1ac6fa47abd301f6

closes odoo/odoo#54770

X-original-commit: dac122935ac5c20526e529b09bf019f15a290d59
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-22 11:29:04 +00:00
qsm-odoo 85531edd1b [FIX] web_editor, *: restore editor UI for selected CSS variables
*: website

Commit [1] broke the UI for some options related to CSS variables when
using Chrome. The commit made sure the string-value CSS variables are
printed with quotes, so that the JS representation of the CSS values can
distinguish them (strings = strings with surrounding quotes, others like
colors, numbers, etc = strings without surrounding quotes). With chrome,
the printed surrounding single quotes are read as double quotes for
strange reasons though... so the value "a" was not considered equal to
the value 'a'.

This commit makes sure surrounding quotes are normalized. This is done
through a new utility function to read CSS variables. This also makes
sure the values are trimmed, and colors normalized.

[1]: https://github.com/odoo/odoo/commit/3a34e39caa8544059dfb1888edc29c62c3efde31

closes odoo/odoo#54757

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-22 10:31:28 +00:00
qsm-odoo 2a19a83762 [FIX] web_editor: fix small memory leak of destroyed snippet editors
In some complex cases, some snippet editors were destroyed but were
still referenced in memory.

E.g.

1) Reorder a snippet gallery image
2) The code is implemented in such a way that reordering create a new
   wrapping column for each image and moves the images in them.
3) This result in having the snippet editor linked to the old columns
   to be explicitely destroyed and removed from memory, but not the ones
   linked to the images as they are still in the DOM (just moved).
4) ... but the snippet editors linked to the images are children of
   the snippet editors linked to the columns. They are thus implicitely
   destroyed... but not removed from memory.

closes odoo/odoo#54643

X-original-commit: e4bf37c7fc892cdba57f0acac8e10f5698184e67
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 09:56:25 +00:00
qsm-odoo 004663f49e [FIX] web_editor: fix editor-lock after gallery image reordering again
The bug was already solved with [1] but was reintroduced later for
another reason. [1] solved the problem by checking that the current
option is not destroyed before asking for an UI update thanks to a
trigger_up (the option was destroyed because of image reordering). The
bug is now reintroduced for the same basic reason: a new trigger_up was
added between the potential option destroy and the destroy check, so
if the option is destroyed, that trigger_up fails to be triggered and
the editor is locked.

This commit solves the problem once and for all, hopefully, with a
more robust solution: only destroy options when none is being
processed. That way we ensure that all trigger_up occuring during an
option activation / update can be properly done.

[1]: https://github.com/odoo/odoo/commit/9eeea4c4107dc15984c475582d5ee58a17cd2568

X-original-commit: 7770430f78ee9e122a732fa042226d362467158e
2020-07-17 09:55:41 +00:00
qsm-odoo a30cc3402d [FIX] web_editor: restore background videos (new imagepicker UI)
Commit [1] broke the background videos feature. This is because the
'we-imagepicker' widget is now a sub-widget of a new 'we-button-group'
widget, acting as a selection choice (same as we-button in a we-select).
When selecting a selection choice, the appropriate option method is
called, with the selection value and params... but the params were
actually the ones of the 'we-button-group' element and not the ones
of the chosen widget 'we-imagepicker'.

This has never been important for we-select widgets but it could have
been. The problem is only solved here in master, generically for all
selection widgets (currently only 'we-select' and 'we-button-group').
The params received are the ones of the active sub-widget combined with
the ones of the selection widget.

[1]: https://github.com/odoo/odoo/commit/bb0cd4d5c82a9c2311f8c45ced0e9fdc0397d292

closes odoo/odoo#54629

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 08:45:06 +00:00
qsm-odoo b4ce6fbc01 [IMP] website, *: add prettier preview of border styles
*: web_editor

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
qsm-odoo bb0cd4d5c8 [IMP] web_editor, *: review background color/image options UI
*: website, mass_mailing, website_blog, doc

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
qsm-odoo d23a9c1954 [IMP] web_editor, *: introduce new "button group" editor widget
*: website, website_form

Basically work just as a we-select but with a different design.

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
qsm-odooandBenjamin Vray b96c0eaf38 [IMP] web_editor: allow to use images in the left panel
Part of https://github.com/odoo/odoo/pull/53930
task-2157252

Co-authored-by: Benjamin Vray <bvr@odoo.com>
2020-07-14 14:43:16 +00:00