Commit Graph
108 Commits
Author SHA1 Message Date
95d0ca4b2c [REF] web_editor,web: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:09 +00:00
Samuel Degueldre 5e811936c7 [IMP] web_editor: replace some bottom shape colors with transparent
Previously, rainy 05 and wavy 06 had a bottom color with a hard edge.
This means that in order to not have a harsh color transition in the
section, the user would have to match the bottom color to the background
color of the section or vice versa. This commit makes it so that this
color is transparent by default instead. This means that the user can
now simply choose the background color and have the same result, without
having to configure two separate colors.

Part of: odoo/odoo#58333

closes odoo/odoo#59420

X-original-commit: 8e6728f7fa486e264737ce068f637c8a76fdb7d9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-07 13:49:09 +00:00
Goaman 55f10ac9a0 [IMP] web_editor: add assets for jabberwock editor
This commit lays the groundwork for the new editor by adding empty files to the assets in
order to change them later on. The new editor is not stable enough to be merged right
now, but delaying it to 15.0 would be problematic as the current editor has many bugs that
we are unable to fix because of how summernote interacts with browser-dependent code as well
as all the hacks that were done on top of it for Odoo since 8.0.
2020-10-02 08:52:40 +00:00
Samuel Degueldre c46204dff9 [IMP] web_editor, *: make media-dialog search odoo media-library
*: website, web_unsplash, website_blog

We have recently created an odoo media library that exposes a public API
for searching for open-source media, including dynamic SVGs that can be
used with the dynamic background-shape system to create illustrations
whose colors can be changed by the user. This commit adds the
corresponding client-side functionalty: search for the images in the
media-library, creating a corresponding attachment when selected, as
well as an option to customize the colors of the dynamic SVGs.

In the process, adaptations have been made in the web_unsplash module to
avoid duplicating code and to adapt code that was making assumptions
that are no longer valid.

To make new users more aware of this feature, all default images have
been hidden from the media-dialog, so that the user is prompted so
search for images. Some tests and tours that were relying on having
default images in the media-dialog (eg in website_blog) have been
adapted to match.

task-2316651
Linked to: odoo/iap-apps#235

closes odoo/odoo#57888

X-original-commit: 7a1308b426f94b33e2bd55e5d58e661067e26ff3
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-16 16:14:37 +00:00
Benjamin Vray 103ed0ae6c [IMP] web_editor: remove collapsed options in editor panel
Remove fold/unfold from the tab 'Style', as we have in fact enough
vertical space. For the UX it is better to remove it from there.

task-2327111

closes odoo/odoo#57726

X-original-commit: fd36b2ad01c902b0d5745b0faaabed9afccede17
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-15 11:35:25 +00:00
Jeremy Kersten 6c5a39ee78 [IMP] website: add data-option-name att to define class
OptionId was previously based on data-js name. But if an option has no js
the classname was snippet-option-undefined, now we fallback on data-option-name
to have a right name, and be easily selectable by theme tour.

X-original-commit: 7b0a147cd43e8e890ebe5a882292a69a5c8c90ac
2020-09-11 16:31:51 +00:00
Samuel Degueldre 5314557a78 [FIX] web_editor: various shape fixes (hide on mobile, bad joint, ...)
This commit fixes various things with the shapes: shapes are now hidden
on mobile by default, the shapes "blobs 02" and "blobs 03" now connect
properly, and the shape pager now shows the name of the current page.
Airy shapes now have embedded media-queries so that they're more visible
in the shape selector. The order of the pages in the shape selector has
been adapted so that shapes that are easier to use are on the first few
pages. A number of shapes have been "cut" differently to leave more
space for content, and some shapes have had their top/bottom anchoring
swapped.

task-2319484

closes odoo/odoo#57279

X-original-commit: c0f62593a4da37e8404dddc0a5762879a5ebbf7f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-08 19:35:02 +00:00
qsm-odoo bbe117e107 [IMP] web_editor, website: introduce foldable zones in the editor UI
Now any set of widgets and rows can be placed in a we-collapse element
so that those elements can be foldable. The first element inside (or
the mentioned "string" on the we-collapse element itself) is used as the
always shown element (with a toggler on its left to toggle the
visibility of the other items).

we-collapse inside other we-collapse is supported as well.

Limitations / Other infos:

- The use of '⌙' and &emsp; characters is not automatic (yet?).
  Sometimes it actually make sense to use them without a we-collapse or
  to not use them in a we-collapse.

- The use of we-collapse is limited to widgets inside the same option.
  So unfortunately, there is no current way to add all bg image options
  in a folable section as those contain many different options. Maybe
  in the future.

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

closes odoo/odoo#56352

X-original-commit: d9c450ac97de40c71aebd487cff725bfda6a577b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-22 17:51:32 +00:00
Samuel Degueldre 42abf8f496 [IMP] web_editor: add webgl image filters
This commit adds webgl image filter to the existing image options,
including a custom filter that lets the user access color-correction
options (saturation, brightness, contrast, sepia, ...) as well as
blending modes for color filters.

Part of https://github.com/odoo/odoo/pull/53114
task-2279190

closes odoo/odoo#53114

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-19 08:32:23 +00:00
stefanorigano (SRI) 772c967abd [IMP] web_editor: review 'o_we_image_weight' design
Part of https://github.com/odoo/odoo/pull/55959
task-2157252

closes odoo/odoo#55959

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-14 19:19:48 +00:00
stefanorigano (SRI) 9587202dec [FIX] web_editor: review indentation of shape icons
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:48 +00:00
stefanorigano (SRI) 374ce7759e [IMP] web_editor, website, *: adjust general ui spacing/alignment
*: website_form

Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:48 +00:00
stefanorigano (SRI) bc77998998 [IMP] web_editor: add 'shape' option svg icon
Part of https://github.com/odoo/odoo/pull/55959
task-2157252
2020-08-14 19:19:48 +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
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 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
Benjamin Vray 798fa36471 [IMP] website, *: add missing options previews
*: web_editor, website_blog, website_form

task-2280397

closes odoo/odoo#53516

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-10 14:51:30 +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 1384354356 [IMP] website, *: review options' order/label + add "⌙" markers
*: web_editor

Some of those "⌙" markers will become foldable options in the future.

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

closes odoo/odoo#53930

Related: odoo/upgrade#1478
Related: odoo/design-themes#332
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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 6c31104fa9 [IMP] web_editor, *: remove snippet panel block icons
*: website, mass_mailing

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
Samuel Degueldre aa8d2a8be2 [IMP] web_editor, *: move image optimization feature to left-panel
*: website, mass_mailing

In continuity with the nline crop, in an effort to make the image
workflow as seamless as possible in the website editor, the image
optimization feature has been moved out of the modal which could be
opened through the media-dialog and into the left panel.

This commit adds a quality slider and a width selector, as well as a
preview of the image's weight to the left panel, and removes the
image_optimize dialog.

This commit also introduces the possibility to add a color filter on
images.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755

closes odoo/odoo#51517

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-06-05 18:11:53 +00:00
Samuel Degueldre 59cd23a4df [MOV] web_editor: rename crop_dialog.js in preparation for inlining
In the next commit the crop functionality will be made into an inline
widget instead of a modal dialog, as such, the name no longer makes
sense.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755
2020-06-05 18:11:34 +00:00
qsm-odoo 7736cde22c [IMP] web_editor, website, *: use new color names
*: mass_mailing, website_blog, website_forum, website_hr_recruitment

Deprecate alpha, beta, gamma, delta and espilon color names and now use
a new color system: o-color-x, with x from 1 to 5.

This will allow to review the colors of all themes to have nice visuals
for the new color combinations classes, without breaking the current
uses of bg-alpha, alert-delta, etc in current websites of customers
(by keeping the old color and classes for compatibility).

This will also allow to uniformize all themes under the same conventions
to enforce BS color override:
- o-color-1 used as primary (as before, for alpha)
- o-color-2 used as secondary (as before, for beta)

Before, some themes were not following the 2 guidelines. The users
using those themes will simply have the possibility to choose o-color-1
and o-color-2 colors accordingly to restore their website without
breaking the new system features.

Another change is that those colors are defined through color palettes
and not theme color palettes. This will avoid them to generate automatic
bootstrap classes which we don't want (alert, btn) and generate the one
we want by ourself.

Note: for mass mailing, the colors and classes also have been renamed
but the system stays unchanged.

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
Samuel Degueldre be54b82afd [FIX] web_editor, mass_mailing: fix assets template unable to load
View rendering from javascript has recently been made to check
permissions (See commits 64d0dab0a6
through ccc98e0169). Some assets required
by the iframe editor are rendered in JS so that they can be injected
into the iframe, but their permissions had not been updated, causing a
crash when trying to create or edit a mass_mailing campaign.

This commit fixes that by adding groups="base.group_user" to the
required templates.

closes odoo/odoo#51598

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-20 13:36:19 +00:00
Aaron Bohy 798931fc39 [REF] web(_editor): move jquery.nearest lib to web
This lib is also used by the Gantt view, so we move it to the
common basis between web_editor and web_gantt, which is web.

Part of task 2205607

closes odoo/odoo#51606

Related: odoo/enterprise#9740
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-05-20 09:33:04 +00:00
fja-odoo 99910b526e [IMP] web, web_editor: integrate colorpicker in colorpalette
Stop using the colorpicker dialog in the colorpalette widget.
Integrate the colorpicker widget in the colorpalette widget. Of course,
the colorpicker behaviors are adapted so that no useless rerendering
of the colorpalette is made on each value change.

The 'reset color' button is now a button like the other colors, no need
for a 'color_reset' event anymore. It is removed and replaced with a
'color_picked' event with color being an empty string. The clear button
now also work on hover.

Also, the topbar colorpalette for text and text background colors now
has the exact same behaviour as the background colorpalette: adding
color preview on hover.

The colorpalette now also closes on 'enter' keypress.

Part of https://github.com/odoo/odoo/pull/46088
task-2195313

closes odoo/odoo#46088

Related: odoo/enterprise#8696
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-15 11:05:00 +00:00
Martin Trigaux 64d0dab0a6 [FIX] *: add group_ids where it is needed
Following the previous commit adding access via groups_id
These views are rendered publicly by specific user
2020-05-14 13:59:10 +02:00
fja-odoo 11c60739e4 [IMP] website, *: warn user about outdated blocks
* = mass_mailing, web_editor, website_crm, website_event, website_form,
website_forum, website_hr_recruitment, website_mail_channel,
website_mass_mailing, website_sale, website_slides

When an outdated snippet's option are activated we display a warning
in the left panel that inform the user about the potential
malfunctions.

To do so the snippet's template key is added to the snippet as
data-snippet.
If a snippet is "t-call" inside another snippet, it will need to use
t-snippet-call instead of t-call to have the key on himself.

Those unique keys are used on snippet selection to retrieve the
snippet's version in the left panel and compare it with the currently
selected snippet's version. Versions are describe with data-vcss,
data-vjs and data-vxml. If a snippet's key is not in the left panel we
consider that snippet as outdated.

Added some tests to ensure that t-snippet and t-snippet-call really have
their template key as data-snippet

Adapted the views to the data-snippet changes adding
data-snippet="tmpl_key".

Part of: https://github.com/odoo/odoo/pull/44569
task-2189669

closes odoo/odoo#50254

X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-27 16:36:31 +00:00
Samuel Degueldre 0b0690a393 [IMP] website, web: add fullscreen mode and frontend keyboard shortcuts
While the edit mode interface is full of useful things, it also adds a
lot of clutter, and alters the page's width and thus, its layout. This
commit adds keyboard shortcut for website editors to use, and allows
them to enter a "fullscreen" mode that hides the editor interface while
remaining in edit mode, allowing the user to have fewer distractions
while editing text content, and a closer rendition of the page's final
layout while editing.

For this, keyboard shortcuts were required, and a few other useful
shortcuts have been added, such as alt-1,2,3 for the navbar, just like
in the backed.

task-2126915

closes odoo/odoo#46953

Related: odoo/enterprise#9295
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-16 09:45:58 +00:00
Julien Mougenot 48ee7272b6 [IMP] *: adapt qunit suite bundle inheritance
Since the test assets bundle name has been changed and its structure is different,
the inheriting assets need to be updated.

Task 2002399
2020-04-07 14:40:53 +00:00
qsm-odoo 0280b5fb01 [REF] web_editor, website: rename editor left panel tabs
- "Options" -> "Style"
- "Theme" -> "Options" (as now contains not-theme-related options)

closes odoo/odoo#46602

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-28 16:17:25 +00:00
Samuel Degueldre c305f89e51 [FIX] web_editor: fix summernote files showing up in media dialog
Due to the infamous web_editor revert, summernote assets filesa are once
again created and stored in DB, but because they do not contain
'assets_' in their name, they would show up in the media dialog. This
commit fixes that by prefixing the created summernote assets file with
'assets_'

closes odoo/odoo#45298

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-13 10:38:25 +00:00
fja-odooandqsm-odoo 218e1cad61 [IMP] web_editor, *: allow saving of snippets
* website, mass_mailing, website_event, website_form,
  website_mass_mailing, website_sale

Now the user can save snippets to use them on other pages.

task-2120409

closes odoo/odoo#40408

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-01-16 14:29:04 +00:00
qsm-odoo 74419dc80b [REF] web_editor: remove useless files
Commit https://github.com/odoo/odoo/commit/eb0ea8efbe932c140302e9f8da33a839bcd73146
removed the use of the 'rte' and 'rte_inline' without removing the tests
themselves. They apparently cannot work anymore as using routes which
do not exist anymore.

This commit removes the test files.

Part of https://github.com/odoo/odoo/pull/41789
2019-12-19 15:15:19 +00:00
qsm-odoo b38253f400 [REF] web_editor, *: use widgets for left panel components
Before this commit, the rendering of inner content of the left panel
options was handled through _buildXXXElement methods in the options
widgets. Now they are handled through sub-widgets which also handle
the user events.

Each sub-widget is notified with the string value it should hold
according to the snippet option target and methods. Each sub-widget
notifies a string value following user interactions, which snippet
options can use to adapt their target through their option methods.

The current sub-widgets introduced by this commit are (others will
follow):

1) we-button
2) we-checkbox
3) we-input
4) we-select (typically containing multiple we-button widgets)
5) we-multi (typically containing multiple we-input widget)

Following this commit only 3 standard option methods remain, which can
be used with any meaningful widget:

1) selectClass

-> Same as before + handle the old 'toggleClass' method when used with
   a checkbox-like widget.

2) selectStyle

-> Same as old setStyle, introduced recently (simply renamed)

3) selectDataAttribute

-> Handle both old selectDataAttribute and setDataAttribute, introduced
   recently

The parameters these methods received are now:
- previewMode: same as before
- widgetValue: the string value the widget currently holds
- params: additional parameters (mainly dataset of the related xml)
    + params.possibleValues (all the possible values for the method,
      meaninful for a select or a checkbox)
    + params.defaultValue (the value that the widget would give if it
      even holds no value)

When defining a method in XML, the given value is the default value.
e.g. data-select-style="34px" data-css-property="margin-top"
-> if set on any widget, allows to retrieve a value from the user to
   customize the margin-top, the default value being 34px.
   -> if used with a we-input, allow to retrieve any value and an empty
      value will be equal to 34px
   -> if used on a checkbox, allow to toggle between no value and 34px.
   -> ...

Hopefully, detailed documentation about all of this will follow. Code
documentation should already be helpful.

Last note: the _updateUI method (replacing the old _setActive) is now
async (so does all the functions calling it). In particular, the _select
method is now async.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
fja-odoo 22c5fc5dd2 [IMP] web_editor, website: generalize colorpicker
Currently we have:
- a colorpicker for background color of snippets
- a colorpicker for foreground and background text (topbar)
- a colorpicker for menu/footer/navbar/etc
These 3 are separate colorpickers with different options.

After this Commit
All 3 will use the same color palette wich allow you to select
theme color, common colors, custom color and transparent filter.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383
2019-11-18 09:56:40 +00:00
qsm-odoo aa9db571e3 [REF] web_editor: update the cropper library
Just after we first added the library in Odoo (in april 2018), the
library was released in its last and deprecated version (4.0.0). At the
same time, the author indeed split its 'cropper' library into 2 parts:
'cropperjs' which is the core of the original library without jquery
and 'jquery-cropper' which is a jquery wrapper of the 'cropperjs'
library. This commit updates our code to use the latest version of those
two libraries.

Note: the commit also removes the lazy loading of the library which is
useless and maybe breaking since it comes with the editor assets which
are themself lazy loaded.

Note 2: we may want to remove the jquery wrapper in another update and
simply use the standard JS library.

Part of https://github.com/odoo/odoo/pull/36880
task-2059480

closes odoo/odoo#36880

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-09-13 14:55:26 +00:00
qsm-odoo 8025205bb4 [IMP] web_editor, *: introduce wysiwyg frontend loader
* website_forum, website_profile

- Share some code between website_forum and website_profile by exposing
  a function in web_editor to instantiate a wysiwyg instance on a
  textarea

- Use no-lazy loaded JS to add a visual loading effect while the
  wysiwyg is not yet available.

This is made in preparation of task-2024197
(see https://github.com/odoo/odoo/pull/35749)

Thanks to @stefanorigano

closes odoo/odoo#36581

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-09-10 12:12:28 +00:00
qsm-odoo 092409edc1 [REF] web_editor, website: review UI labels and icons
Part of https://github.com/odoo/odoo/pull/36515
2019-09-10 11:49:34 +00:00
qsm-odoo 4f27e52cab [IMP] web_editor, *: introduce and restore new web_editor UI
* mass_mailing, note, website, website_blog, website_form,
website_mass_mailing, website_sale

This commit, unfortunately, mixes three things:

- Restoring as much as possible the scss organisation to allow styling
the web_editor UI properly.

- Fixing some bugs like a border around the page once the editor is
loaded, no ability to scroll the snippets, etc

- Introducing a whole new UI for snippet options: a left panel instead
of the old dropdown & button overlay.

Note: this commit also do some linting and ES6 convertion even though
some of it has been done in the parent commit.

Note 2: some elements that were removed are still styled in the POS apps
but this is because part of a feature was removed while leaving dead
code behind, this is handled in another PR which is to be merged
(https://github.com/odoo/odoo/pull/36136).

Part of https://github.com/odoo/odoo/pull/36068
task-1942370

closes odoo/odoo#36068

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-28 09:04:55 +00:00
qsm-odoo b47f097feb [FIX] web_editor, *: review assets organisation
* mass_mailing, point_of_sale, website

- Lib files were included twice
- Variables files were split but added multiple times in the same assets
  bundle
- Useless assets templates were defined or split
- ...

Part of https://github.com/odoo/odoo/pull/36068
Related to task-1942370
2019-08-28 09:04:25 +00:00
56d0c1ed97 [REF] web_editor, mass_mailing: new iframe mechanism
Since we reverted the saas-12.2 editor in favor of the 12.0 one,
we faced a dilemna regarding how the editor iframe is handled in
mass_mailing.

The 12.0 version was using a special controller to get the website
assets required for mass_mailing while the saas-12.2 version used
a completely different mechanism that was, obviously, not handled
by the 12.0 version.

We did not want to reintroduce the old controllers who were
considered to be a hack to load the assets in the mass_mailing
iframe. However, we were very cautious about changing the editor
itself to avoid introducing new bugs in the editor core of 13.0.

The approach we chose at the end, is to use the loadAsset mechanism
introduced in saas-12.2 to load the necessary assets and inject them
in the mass_mailing iframe. This did not reintroduce the controllers
nor did it require to change the code of the editor itself. However,
it required moderate changes to the wysiwyg interface.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-22 06:41:05 +00:00
1eb1c2b029 [REF] web_editor: adapt wysiwyg tests to older summernote version
These modifications crystalize the behavior of the old editor, even
if it makes less sense than the behavior of the saas-12.2 one.

In some cases, the only reasonable adaptation we could do for 13.0
was to delete the tests, as these tests relied on mechanisms of
the newer version of summernote introduced in saas-12.2 which
cannot be easily replicated in the older version from 12.0 that
we are reintroducing in this PR.

It is sad to see these tests go, but we knew this was going to be
something we would lose in reverting back to the older editor.

That being said, since these tests were not present back in 12.0,
we are simply back to the 12.0 state of things, not worse. Don't
weep for them though, they will be back in Odoo 14.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 19:11:31 +00:00
35b61822a8 [REV] wev_editor, website: revert saas-12.2 editor
This commit reverts the saas-12.2 editor by putting back the editor
of Odoo 12.

The saas-12.2 editor was an intermediate work between the previous
editor of Odoo 12 and the new one slated for Odoo 13. It was unstable
but it was supposed to be replaced by the new editor of version 13.

However, since the new editor has been postponed to Odoo 14, the
saas-12.2 one would have been staying in Odoo 13, which would have
been a nightmare to maintain. To avoid this outcome, we chose to
put back the 12.0 editor in its place.

This has the particular advantage that Odoo 13 will share the same
bugfixes as Odoo 12 and 11 as they all run under the same core
editor, while the saas-12.2 one would have been an entirely
different beast to maintain.

This is a partial revert of f2969923.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 18:52:36 +00:00
Julien Mougenot edc60f7fb4 [REF] web,web_editor: moved ColorpickerDialog to web
The reason this widget was moved is that the next improvement
([IMP] base: Configure document layout) defines a new field (FieldColor)
which needs to call the colorpicker dialog inside of the base module.
This couldn't be done while the dialog was located in the wysiwyg assets.
2019-07-29 08:28:15 +00:00
Kishan Gajjarandqsm-odoo 34c4b3ad8a [IMP] website_mass_mailing, *: improve newsletter snippets
* website, mass_mailing, web_editor

This commit adds various improvements in newsletter snippets as follow:

- Improves UI for newsletter popup.

- We only had one popup for all websites. Now, we can have a different
popup for each website.

- The popup was not appearing on mobile/tablet devices. Now, in
mobile/tablet devices, the popup appears automatically after 5secs.

- Added the ability to customize the whole editor popup like any
editable area (background colors, etc).

- User needed to enable popup snippet from the settings. We removed that
setting so now popup snippet will always be available.

- Added new snippet "Newsletter block".

- Display notification after successful subscription the same way for
all newsletter snippets.

Closes https://github.com/odoo/odoo/pull/29353
task-1903256

closes odoo/odoo#29353

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-06-25 09:20:35 +00:00
Thomas Werland 515fb62fc4 [IMP] base_geolocalize,web_editor,doc: create map_view
In order for the map view to work properly:
- I moved scss property to a  file only scoped to website module.
- moved the definiton of "partner_latitude" and "partner_longitude" from
base_geolocalise to base/res.partner

closes odoo/odoo#32487

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-11 07:36:53 +00:00
Sébastien Theys 87a35d4263 [IMP] web, web_editor, *: add media image optimize dialog
* = website, website_blog

The goal is to give the user an opportunity to optimize his images before using
them.

For this we introduce a preview/configuration dialog after every image upload,
where appropriate default values are filled for the quality and resolution,
based on where the image is going to be used. Since this is not going to be
perfect all the time, we still allow the user to configure them, and we display
a preview to ease this process.

Indeed it is important for SEO and for usability in general that the images are
as light as possible in size.

Technically the original image is uploaded and saved first, and then it can be
optimized. This way the upload only happens once, and the preview can be
computed from the already saved image.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00