Commit Graph
3424 Commits
Author SHA1 Message Date
Patrick Hoste b5c87d86ca [IMP] website(_event): replace old event snippet by new dynamic one
PURPOSE

Replace the old event snippet which was a simple template with a
javascript file doing a rpc by a new one directly inherited by the
dynamic snippet.
The old snippet was displaying a list of the upcoming events based
on the user's localization. With this commit, it will be completely
replaced by the new snippet. The migration will convert the old
snippets to avoid versioning and keeping ugly code.
The new snippet allows the user to set multiples tags to display
only the wanted events on the website.

LINKS

Task-2489680
PR : odoo/odoo#68644

Related: odoo/upgrade#2406
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-17 13:05:53 +00:00
Tom De Caluwé 4fd5fd4a97 [FIX] web_editor, website: fix removal of last item inside active slides
A bug currently makes the carousel snippet collapse/disappear when its
active contents are removed. This happens because after the removal,
the carousel no longer has an active item.

The solution that was chosen was to not allow the removal of slides
unless using the dedicated option which is there for that. This solution
has the advantage to also allow users to create empty slides (using a
background image for example) by simply removing the columns inside.

Note: Newly created carousels will include the oe_unremovable class on
their slides. As such they will no longer depend on isEmptyAndRemovable
checking them for having a carousel-item class on the parent.

task-2506165

closes odoo/odoo#79892

X-original-commit: 0cf36a227e7b90fb64b1bc8024de813894d10d14
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-16 19:21:14 +00:00
fde251330d [FIX] website: fix sharers of share snippet
The whatsapp sharer was fixed via [1]. This uses https for all sharers
and fix the pinterest one using the logo image with their new API.

[1]: https://github.com/odoo/odoo/commit/62575b75ff48a34df23f8742737226949f13c13c

closes odoo/odoo#79891

X-original-commit: 45497060d9185e7fddb3fc6fcfcbcb81040c8d8b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: jpr-odoo <jpr@openerp.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-11-16 18:39:20 +00:00
Romain DerieandSiddarth Gajjar 7ab8fc9eda [FIX] website: fix usability of the popup snippet
There were some usability issues with the popup when a video was
inserted inside it:
- The video would be playing before the popup is shown and the user
  would thus miss part of that video (potentially a lot, depending of
  the set popup delay).
- The video would continue to play in the background after closing the
  popup.

task-2251203

closes odoo/odoo#79802

X-original-commit: 5ec45659fe89f14a9c770d982e257d75931033d8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Siddarth Gajjar <sga@odoo.com>
2021-11-16 10:49:20 +00:00
Siddarth Gajjarandqsm-odoo a66d347606 [FIX] website: fix background video placement in popup
Before this commit, if you add a background video in a popup, the video
frame will not setup properly because the _adjustIframe function cannot
find wrapperWidth and its ratio.

After this commit, _adjustIframe will be called again once the popup
is opened.

task-2251203

X-original-commit: 2b571bd012c8a1226d17edb2ee9dd2e6f74ce5d1
Part-of: odoo/odoo#79802
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-11-16 10:49:19 +00:00
jpr-odooanddwa-odoo f2bace6518 [IMP] website: add min & max option for chart axis value
This commit introduces min & max input options for the chart values of
the axis. It will be visible only for the line and bar chart.

- When min and max values are same, we fix this by changing the min
  value to zero and multiply provided value by 2 to set max value.

- When min value greater than max value, we swap the values.

- When the min value is given and the max value is not:
    - If the min value is smaller than greatest value of the chart, then
      the max value is set to the greatest value of the chart.
    - Otherwise, the given minimum value is used as maximum value and
      the minimum is set to 0.

- When only the max value is given then the minimum value is set to 0.

task-2250766

closes odoo/odoo#52221

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: dwa-odoo <dwa@odoo.com>
2021-11-15 14:27:06 +00:00
Thibault Libioulle f2b13dd0ec [FIX] website{,_sale}: fix search product with several categories
This commit fixes an issue when there are several public categories on
a single product. Categories are shown side-by-side under product name
in the search bar.
This commit also fixes the issue where the `Category:X` text is matched
and highlighted whereas the search text is not used to match the product
categories.

Steps to reproduce :
    - Install eCommerce
    - Add several eCommerce Categories to a product
    - Go to shop
    - Search for the product in the searchbar
    - Traceback

Current Behavior :
    - Traceback when generating the results in the quick search bar.
      It's not expected to have several categories in the current
      implementation.
    - If all products have a unique category, then the text in
`Category:X` is matched and highlighted.

Desired Behavior :
    - No traceback
    - When there are multiple categories, an extra link should be
      present on each category rather than a unique link on all
      categories.
    - The product categories don't have to be matched.

Related PR: #79258
task-2680726

closes odoo/odoo#79363

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-11-15 12:53:20 +00:00
qsm-odoo 1ebc7c301b [FIX] web_editor, website: fix onFocus/onBlur flow + add test
The flow has been broken multiple times across the years. Let's add a
test in all stable versions.

For the 14.0 forward-port, the test came with a fix which restores the
13.0 flow which we tried to change in 14.0... but only ended up broking
it. Indeed, with [1], the 13.0 was fixed. And, with [2], we tried to
simplify the flow... but the explanation given by the commit is just
wrong: the flow was just broken and the simplification that was to be
done in fact practically never occurs. The more the reason to add a
test, proving how the flow is working. The simplification may be done
someday but not sure it is really worth it.

For the 15.0 forward-port, another fix was needed because of [3] which
introduced a bug which makes the onBlur method be called multiple times
when hiding a whole editor hierarchy.

[1]: https://github.com/odoo/odoo/commit/076992bdf099f3a645c9a1ef6df2cdcccbf1c2b2
[2]: https://github.com/odoo/odoo/commit/5c007305c9998ade32c6677cac5552101c3a96af
[3]: https://github.com/odoo/odoo/commit/806a8db35b5e0e6a461422f5bba7c97180c3ef29

closes odoo/odoo#79734

X-original-commit: 0acc5e784b15d9c963660da3781763448503f33e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-14 21:40:48 +00:00
Nicolas Bayet e68a9d37dc [IMP] web_editor: allow to use link popover everywhere
Before this commit, the link popover was only available in the website
builder. Now it is available anywhere the wysiwyg is used.

Task-2678412

closes odoo/odoo#79542

X-original-commit: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-09 14:00:56 +00:00
Nicolas Bayet d5a031a9a3 [FIX] web_editor, website: only save dirty element
Before this commit, when inserting a new snippet or moving a snippet
that was already in the page would temporarily create hooks (`we-hook`)
in the page. The insertion of thoses hooks would trigger mutation
in the dirty observer (observer defined in edit.js) and mark all
oe_structure for which a hook was temporarily inserted.
Thus, creating unnecessary views in the backend.

Now, the code skip the mutations of the drag and drop hooks.

Task-2567752

closes odoo/odoo#79394

X-original-commit: 1b80fe9b56acea09a6784691561df65fe6349f50
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-08 10:15:56 +00:00
qsm-odoo 95ca988113 [FIX] website: fix video loading
task-2376327
2021-07-16 11:26:38 +02:00
Benjamin Vray f534d20674 [FIX] web_editor, *: fix active class disappearing on tabs snippet
* = website

Before this commit, the active class of the tabs snippet buttons
disappeared when leaving the edition of the buttons.

After this commit, it is no longer possible to enable link options for
the buttons of the tabs snippet and accordion snippet. Being able to
customize these buttons introduces too many bugs and is not really
necessary.

task-2656662

closes odoo/odoo#79190

X-original-commit: 7f33cdcd14ef753cc5bf823bfc1de0d2431e285a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-29 12:39:58 +00:00
xO-Tx 04f09503b2 [FIX] web, website: fix initAutoMoreMenu on user navbar
The current code in 'initAutoMoreMenu' doesn't work properly
on navbar after the update on dropdown in [1]. Small tweaks
were added in this commit to fix that.

[1]: 84715436d87bb05b421bc9ccaacda67d07571690

task-2618929

X-original-commit: 29b9280c44534d2f210dbcea83e0049365949f48
Part-of: odoo/odoo#78959
2021-10-26 07:48:00 +00:00
Tom De Caluwé f81f2a124c [IMP] website: prevent clicking while starting the editor
When visiting a page with enable_editor set to true, the web editor
will be automatically started. However, while the editor is loading,
the end user can still click other buttons in the navbar.

For example, some changes in the web editor require a save and reload
of the current page being edited. After saving, the same page will be
reloaded with enable_editor.

This commit blocks any clicks while the editor is being loaded.

task-2607755

closes odoo/odoo#78721

X-original-commit: 89bdfcd16828e1432900ea46118fd6ddadf96f2d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-21 09:56:47 +00:00
Benjamin Vray 9dd8f06117 [FIX] website: prevent scroll button editing
Before this commit, it was possible to edit scroll buttons with the
editor toolbar.

task-2656662

closes odoo/odoo#78637

X-original-commit: ca5a36323900a27896761ed12c002d22b6c6cf53
Related: odoo/design-themes#523
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-19 15:59:07 +00:00
Barad Mahendra 281b65a943 [FIX] web,*_*: fix the html content in notification
Currently markup-ification of the legacy notifications system
display the html content in notification layout for some of the
notification of document and planning from commit: https://github.com/odoo/enterprise/commit/ba44461fea337ed2e5adbdfa1e8eede00b036def

So here in this commit, we make the method `makeLegacyNotificationService`
always `_.escape(message)` and pass `messageIsHtml: true` to the owl
notifications system so notification with html content will be displayed
properly.

Task-2657391

closes odoo/odoo#78627

X-original-commit: 7ce6d8d70be79c9c626865598b898dce9a18b045
Related: odoo/enterprise#21782
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-10-19 14:43:42 +00:00
Benjamin Vray 34c401caf8 [FIX] website: fix save animated snippet
Before this commit, when dropping custom snippet (or saved snippet)
containing an animation in the page, the animated element of the
snippet remained hidden.

task-2664876

closes odoo/odoo#78493

X-original-commit: 61d7744ca988641bd4d8a4006350ec197eece25a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-18 10:21:58 +00:00
Benjamin Vray 2e57d784d3 [FIX] website, web_editor: fix overlay options of the timeline snippet
Before this commit, the CSS of the overlay option buttons of the
timeline snippet was broken.

task-2648348

closes odoo/odoo#78491

X-original-commit: 13770d650def3107378fe4010aac48dc85a5256a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-18 10:21:49 +00:00
Younn Olivier 46c0bf7827 [FIX] website, mass_mailing: remove composed css classes
Recently, [1] broke the style of a few snippets, because it was adding a
:not selector to the parent css class, that was used to define children
classes that were adding a suffix to the parent class name with the &
symbol.

It was decided that every snippet css class should be explicitly
declared to avoid breaking the style when adding selectors to the parent
class. This will also prevent breaking the style when adding a new css
version for the snippet.

task-2660921

[1]: https://github.com/odoo/odoo/pull/77312

closes odoo/odoo#78413

X-original-commit: af6785599358d2dcb9ff811afc2e558a94d9704d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-15 16:13:47 +00:00
qsm-odoo 05765de195 [FIX] website: properly re-show the header when scrolling to the top
Sometimes, when using the "standard affixed" header effect, when
scrolling to the top, the header was kept hidden and left a blank space.

This happened in fact systematically when scrolling to the top very
fast. Indeed, in that case, the code went through the header update
only once and was not able to go from state 3 (page scrolled header
visible) to state 1 (page not scrolled header visible) without going
through state 2 (page scrolled header invisible) and you thus ended
with a mix of state 1 and 2: page not scrolled and header invisible).

Closes https://github.com/odoo/odoo/issues/71449

closes odoo/odoo#78268

X-original-commit: 20648ef2134672587c25fd3c7c79ed3825728b38
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-13 10:02:38 +00:00
Tom De Caluwé 6b89bf62be [IMP] website: finish a text edit step in a tour when clicked
The idea of a text edit step is considered clearly communicated to the
end user from the moment the trigger is clicked ( as opposed to the
step waiting for actual input from the end user). This way an end user
can finish the tour faster without actually having prepared custom text
content yet.

task-2580338

closes odoo/odoo#77720

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-10-08 16:08:48 +00:00
Victor Feyens ab022ec12d [FIX] *: target v15.0 documentation with doc links
X-original-commit: acc95ec204baa1dddbe292c379a1768fe1deccbf
Part-of: odoo/odoo#77923
2021-10-07 17:59:52 +00:00
fb20b16d48 [FIX] web_editor, *: review icon buttons sizing and paddings
*: mass_mailing, website, website_sale

Before this commit, it was impossible to add `fa-fw` directly on a
`we-button` as it would make the icon half invisible, since the whole
`we-button` would have the font-awesome `.fa-fw` css rule applied on it;
width: ~1.28em.

Then, one would need to insert a `<i/>` tag inside the `we-button` for
it to work.

This commit improves that behavior by handling automatically such cases,
and will preserve the purpose of the `fa-fw` class which is to have a
fixed width for those icons.

Note that the util class introduced in [1] (o_we_button_icon renamed
here in o_we_icon_button) is still useful to handle the case of svg
images, they are not allowed to shrink, the same way the fa buttons are.

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

Related to task-2172311

closes odoo/odoo#77980

X-original-commit: e8ab9d76b802e80bb386812e4c8566825cbc2c92
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-10-07 13:09:26 +00:00
Romain Derie de0308e87f [FIX] web: remove the command palette from the frontend
There is multiple issue with the palette in the frontend:

First, the command palette is bound to CTRL+K, which need to be bound to link
creation as this is an universal keybind, as CTRL+P CTRL+F are, as any other
edition app in the world does.
(Note that link creation is not only for edit mode but also for end user, eg
forum post)
History of the keybind:
1. Command palette was introduced with CTRL+K
2. The keybind was changed to CTRL+M to restore CTRL+K for link edition, see
   8727ed2766
3. The keybind change was reverted and command back to CTRL+K, as CTRL+M can't
   be used on MAC

Second, the command palette do not correctly work in the frontend, the menu are
not opened when an entry is selected, and the submenu are not shown in the palette
when the menu was opened before opening the palette.

Lastly, the CTRL+K in frontend does not only open the command palette but it
also create a link in the background of the palette being opened.. which
result in very bad usability..
The one expecting a link has to deal with a palette.
The one expecting a palette has had a link created without really noticing it.

task-2659885

closes odoo/odoo#77879

X-original-commit: 6135b04738a58564592f438364f5a147ce9c471f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-10-05 15:41:46 +00:00
Younn Olivier 67ee284918 [FIX] website: keep focus on snippet when changing visibility
Triggering the event 'snippet_option_visibility_update' with show
parameter set to false would deactivate the snippet.

task-2629245

X-original-commit: a8d1c162ebfc8d8f80794d3a1e57008c575b3963
Part-of: odoo/odoo#77873
2021-10-05 15:41:27 +00:00
xO-Txandqsm-odoo dd55d6376c [FIX] website, *: fix content/design of header templates
*: web_editor, website_sale_wishlist

The goal of this commit is to fix the issues with the header templates
and their related options. Such as:

- Alignment of inline language selector
- Alignment of CTA / Template content
- Add missing CTA in some templates
- Bugs with off-canvas hamburger menu

Unfortunately, it will require more work to make everything perfect.

task-2636546

closes odoo/odoo#77862

X-original-commit: 2a000e33c5a44ddf0a777b43d8266cc413d8e4e2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-10-05 14:18:01 +00:00
qsm-odoo 0efc4276fe [FIX] website: properly show selected header links style
Since [1], method names of user value widgets are sorted alphabetically
to ensure consistency. This broke widgets using both the
customizeWebsiteVariable and customizeWebsiteViews methods as the
non-alphabetical order is unfortunately the right one there.

Until a better system is implemented, this fix simply switch those two
methods order specifically.

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

X-original-commit: 4ee47afb3709862c6ecd8e19e7aa7db5016e528e
Part-of: odoo/odoo#77862
2021-10-05 14:18:00 +00:00
stefanorigano (SRI) 27604376a9 [IMP] web_editor, website: improve "palettes-chooser" dropdown design
This commit reviews the component design in order to match the
"Configurator" one.

As a result, 'color-4' and 'color-5' are hidden in the palette-chooser
while remaining visible/editable once the palette is active.

This commit will also reorder color fields in the sidebar and in the
colopicker in order to match both the palette-preview & CC-list colors
order.

Beside design consistency, another reason behind these changes goes back
to the initial stages of the color system introduced with v14.

At the very beginning the system was designed to handle 3 custom colors
+ "locked" black and white.
Being able to edit black and white sounded interesting at that time;
as a result 'color-4' and 'color-5' have been introduced in the
system.

Despite being a powerful tool for designers and pro-users, the edition
of these color has been proven to be tricky an potentially unsafe.

Together with new default palettes that standardize 'color-4' and
'color-5' to safe values, hiding these color from the list simplify
the palette selection process and aims, implicitly, to communicate to
"normal" users that these colors are "not part of the palette", while
somehow related.

task-2656337

closes odoo/odoo#77857

X-original-commit: 02aba326710523bf210644e9038198059db1672c
Related: odoo/design-themes#514
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 14:17:48 +00:00
stefanorigano (SRI) 0d5244e4d1 [IMP] website: improve default palettes
Prior to this commit default palettes were picked from the general
library in an attempt to provide as much variety as possible.

Unfortunately they didn't cover the entire primary colors spectrum and
some were "challenging" to customize (eg. mild-tone colors barely
readable in certain circumstances).

This commit defines new safest palettes that cover a wider range of
primary colors (ref. ~2 palettes for each column in this page
https://getbootstrap.com/docs/5.0/customize/color/#all-colors).

task-2656337

X-original-commit: 405e5470d2f950877d22420462c2e14922f77c35
Part-of: odoo/odoo#77857
2021-10-05 14:17:48 +00:00
stefanorigano (SRI) 48b87b4c7f [FIX] website: limit palettes number proposed by the ui
Prior to this commit the entire palettes library (139 entries) was
rendered into the "Theme" tab palettes dropdown.

The final result was overwhelming, especially considering that palettes
were not ordered by color. Moreover, since palettes have been designed
to provide variety within themes, a lot of them appeared very similar
(if not exact clones) when compared in the context of a general library.

This commit keeps palettes' definitions to avoid breaking
pre-existing DBs design, but will propose the user the "configurator"
ones (+ the 2 system ones) only.

Themes can eventually inject a preferred palette in the list in order to
match screenshoot and "pre-configurator" demo content.

This commit also removes the previous prefix-based ordering system, now
obsolete. Indeed several themes use palettes defined by other themes,
invalidating the prefix mechanism.

task-2656337

X-original-commit: 9ff9417d1d5ccb85e0d0751acc8de5faced30236
Part-of: odoo/odoo#77857
2021-10-05 14:17:47 +00:00
stefanorigano (SRI)andqsm-odoo 67bd29fb0f [FIX] website: fix o_footer_scrolltop default color definition
This commit fix a minor issue caused by the assumption that 'copyright'
block colors would have been always defined by default.

Indeed with a48a30f we introduced the possibility to have "transparent"
copyright blocks, invalidating `$-copyright-color`computation when
palettes don't specify a color.

This commit also handles the case of transparent footer, mixing with the
body color.

task-2656337

X-original-commit: 1b9fac8de08f042561a14b9b6ee5ae51b277705d
Part-of: odoo/odoo#77857
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-10-05 14:17:47 +00:00
qsm-odoo a177593572 [FIX] web_editor: restore column count snippet option
When decreasing the number of columns through the column count snippet
option, the editor entered a deadlock situation.

This reverts [1] which is the cause, trying to await the UI update
during a snippet removal. This commit first prevents the deadlock while
waiting for a better solution to be implemented.

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

task-2652904

closes odoo/odoo#77848

X-original-commit: ae219ec06baf0280c76ae09b1453cc1481eece30
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 14:17:18 +00:00
xO-Tx dde609a838 [IMP] web, website: remove website menu loading effect
The goal of this commit is to remove the menu fade-in effect
on page load since we can now call the initAutoMoreMenu in
non-lazy JS code.

When 'initAutoMoreMenu' called, images won't be loaded yet,
that's why we add a class: '.o_menu_image_placeholder'
to set a default size on images and once all images are loaded,
we reupdate the menu.

task-2618929

X-original-commit: 6be166df24dedbe4729e1e7bfe6a302713932b74
Part-of: odoo/odoo#77843
2021-10-05 14:17:13 +00:00
xO-Tx 92d9c84c83 [IMP] website: use initAutoMoreMenu for website menu
The goal of the 'autohideMenu' feature: instead of having the menu
items wrapped on multiple lines, they are hidden and only when we
compute how many items we can show on one line, we show the menu.

This implementation was fine in old versions when we did not have
the lazy loading of the JS yet.

The goal of this commit is to replace 'initAutoMoreMenu' by code
that can be called from a non-lazy loaded JS file so it will be
possible to remove fade-in effect from it.

task-2618929

X-original-commit: 7affc29c9b3fc85c27c10d0b8ba600ebdaf311ac
Part-of: odoo/odoo#77843
2021-10-05 14:17:13 +00:00
xO-Tx 898d181c7f [MOV] *: move initAutoMoreMenu to a non-lazy loaded file
*: web, website

task-2618929

X-original-commit: 0a031fca52e92ce052522446b0c1751aac5dc572
Part-of: odoo/odoo#77843
2021-10-05 14:17:12 +00:00
xO-Tx 0de634965a [REF] web, website: rewrite initAutoMoreMenu method
The goal of this commit is to make initAutoMoreMenu fully
non-jquery and totally independant of other odoo utils.

task-2618929

X-original-commit: 7be1bb9083c786064fa140c811952e7735ce5539
Part-of: odoo/odoo#77843
2021-10-05 14:17:12 +00:00
Julien Banken fbedc9c0b9 [IMP] website: improve the visitor kanban card of the website module
On the page 'Visitors' page of the website module (backend), the cards
can be miss-aligned on small screen size. To improve the responsiveness
of the cards, we will use the `col` and `col-*` classes of Bootstrap
with some specific breakpoints (e.g. `col-sm-*`, `col-lg-*`, etc). We
will also use flex display to reduce the number of custom css rules.

task-2524363

closes odoo/odoo#73355

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 12:35:52 +00:00
Guillaume ClemensandTom De Caluwé bb6379e4f9 [IMP] website: add accordion styles
This commit adds new classes and options to the accordion snippet in
order to add new styles and allow switching the side where the collapse
status icon floats to.

task-2457232

closes odoo/odoo#69543

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-10-04 18:38:43 +00:00
Antoine Guenet 0249b0ce1a [REF] mass_mailing, website: rename conflictual snippet options classes
The css of some website snippets conflicted with their mass_mailing
equivalents. A quick, non-intrusive solution had been to contain that
css so it wouldn't conflict. This replaces that solution with the more
neighborly renaming of said snippets in mass_mailing. This way there is
no added awareness of mass_mailing within the code of website.

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Antoine Guenet ff9a77c4be [FIX] mass_mailing, web(site,_editor): restore original website options
Commit [1] copied a lot of website snippet options into mass mailing.
Some were moved to web_editor and xpathed to be used in both without
duplicating code. Sadly that is not without side effects and it was
therefore decided to duplicate them instead so they can live separate
lives in the future.

[1] https://github.com/odoo/odoo/commit/4f7cd33d0fd69ee5984d0968233ffc73d7751030

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Elisabeth Dickinson 62f766b36c [FIX] website: stop website snippets CSS from affecting mailing snippets
CSS from website's snippets was affecting snippets in mass_mailing with
the same class. To counteract this, we adapted the selector to exclude
mailing snippets.

task-2554899

X-original-commit: 40348e9c314bb1211b8a49690311733abcb4ada6
Part-of: odoo/odoo#77724
2021-10-04 15:31:10 +00:00
Antoine GuenetandElisabeth Dickinson d0c2d8e9a1 [ADD] mass_mailing, web[site|_editor]: website snippets to mass_mailing
The following snippets (and their relevant options) were added to
`mass_mailing`, mostly duplicated from the website builder:

- s_cover
- s_title
- s_text_block
- s_comparisons
- s_color_blocks_2
- s_three_columns
- s_image_text
- s_text_image
- s_picture
- s_features
- s_numbers
- s_masonry_block
- s_media_list
- s_showcase
- s_company_team
- s_call_to_action
- s_references
- s_product_list
- s_features_grid
- s_alert
- s_rating
- s_blockquote
- s_hr
- s_text_highlight
- s_coupon_code

The following snippets were removed to make way for the new:

- s_mail_block_banner
- s_mail_block_title_sub
- s_mail_block_paragraph
- s_mail_block_comparison_table
- s_mail_block_two_cols
- s_mail_block_three_cols
- s_mail_block_image_text
- s_mail_block_text_image
- s_mail_block_image
- s_mail_block_footer_separator
- s_mail_block_steps
- s_mail_block_discount2

The following standalone snippet options were added, mostly duplicated from the
website builder:

- Box
- layout_column
- SnippetMove
- snippet_options_text_align (via web_editor)
- snippet_options_width (via web_editor)
- snippet_options_block_align (via web_editor)
- BodyWidth (based on ContainerWidth but only for the mailing's body)
- minHeight
- so_snippet_addition
- so_content_addition
- sizing_x
- vAlignment

Styles and selectors were adapted to the specifics of `mass_mailing`.

task-2554899

X-original-commit: e5e1d4255ab416581b2ef7159c0c28540528771c
Part-of: odoo/odoo#77724
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2021-10-04 15:31:07 +00:00
b63ee52552 [FIX] *: remove scss 'extend' from dropdown components
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.

Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.

In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.

Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.

// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
  <button class="dropdown-item" type="button">Action</button>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
  <li class="o_dropdown_item">
     <span>Action</span>
  </li>
  <li class="o_dropdown_item">
     <a href="#">Another action</a>
  </li>
</ul>

// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
  <span class="dropdown-item">Action</span>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)

closes odoo/odoo#77649

X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-04 07:57:00 +00:00
qsm-odoo a54f11edb1 [REF] web_editor, website: remove some start15 compatibility code
With the forward-port at [1], it was forgotten to adapt the PR to
simplify the code that was added to support current start15 databases.

[1]: https://github.com/odoo/odoo/pull/77255

closes odoo/odoo#77630

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-01 20:42:07 +00:00
Sébastien Mottet (oms) fdde7b7240 [FIX] website: hide control panel elements in themes kanban view
The message 'Don't worry, you can switch later' and a close icon
redirecting to the website are displayed in the control panel of
the theme kanban view. When we reach this kanban view from the
website settings we want to hide this message and this icon.

task-2610896

closes odoo/odoo#77548

X-original-commit: 72ed96c6febf299dac9b352714c6d5ba05508446
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-30 17:12:05 +00:00
qsm-odoo d7866f1536 [FIX] website: fix non-full layouts combined with footer scroll effect
Since [1], a footer effect option has been introduced which allows to
have the content hovering the footer to then reveal it when reaching the
bottom of the page (instead of having the footer to scroll like the rest
of the content).

To achieve that, the body color was forced on the snippet container (the
`<main/>`) so that the transparent snippet still appear with a
background color for the time they go over the footer.
That background color should however not have been forced in non-full
layouts as another is already forced in that case. In those non-full
layout, the "full" body background (= background of color combination 1)
is applied on the snippet container but the "body" color is another
color which is customizable by the user too.

[1]: https://github.com/odoo/odoo/commit/5879e40445f0176d545b4a50f7f7ec33b2e171c8

Related to task-2590182

closes odoo/odoo#77531

X-original-commit: b0f03cb1d628d29b8a67fc954dc40877dfd1783e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-30 15:57:51 +00:00
Romain Derie 09d1f69e9c [FIX] website: prevent always showing debug icon in frontend
Commit [1] migrated the old debug manager to the new OWL one.
But is was missing a check, to actually ensure we are in debug mode before
showing the icon.
Without this fix, the debug icon is always shown, even if not in debug mode.

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

closes odoo/odoo#77292

X-original-commit: dc689838a6514fcbe0c233297123f46b23199ddc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-09-28 10:53:20 +00:00
Krunal Trivediandqsm-odoo b03b762ad0 [FIX] website: disable scrolling effects for sidebar headers
- Edit the website
- Select the header and set the scrolling effect to fixed
- Set header template as 'sidebar'
- Save
- Scroll -> The website does not properly scroll.

This is now fixed.

closes odoo/odoo#77277

X-original-commit: f253a09214af2f4393031e0610d76f91ea63f833
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-28 09:29:18 +00:00
Sébastien Mottet (oms) 433f6c2758 [FIX] website, web_editor: prevent mega menu removal
The user was able to remove the mega menu snippet without removing
the corresponding link in the menu. To avoid this flow to happen
we removed the delete button for the mega menu snippet. We also
handle the case where the user remove the mega menu snippet element
by element. On last element removal we put back the original template.

task-2636545

closes odoo/odoo#77256

X-original-commit: 97810a9c40396bb27cb5779937734849d185cf1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-28 09:29:09 +00:00
e91beddac0 [IMP] website: add ability to conditionally show form fields
Allow the user to create forms whose fields can have a conditional
visibility, meaning that the field is only visible if another field in
the form meets certain conditions.

The previous hidden checkbox is replaced by a select with 3 options
(visible, hidden, visible only if).

task-2431285

closes odoo/odoo#77255

X-original-commit: 2dcbfecf3c10687a2cd3af36335d5be70c904fce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Arthur Detroux (ard) <ard@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-28 09:29:03 +00:00