Commit https://github.com/odoo/odoo/commit/bb0cdec4594fab8c22265ed8af0c2d431a263b72#diff-e4ca107fe5c84ec39ba346fb90d1bdf6R76
added strange code affecting the whole editor when website_blog was
installed. To stay consistent, commit https://github.com/odoo/odoo/commit/80f54f563a3917828c5f67dfe9c44d0f6b0c5324
moved it in standard website and marked it as to review.
It is in fact the cause of a bug: *all* drop areas appeared with a big
editor text "Drag and drop a building block here" because of this code.
As a fix in stable, the problem was solved so that the code works as
intended: adding an editor message on a normal .oe_structure makes it
an .oe_structure.oe_empty automatically. Here in master, this code will
simply be removed and it will be up to the devs to not make errors in
their xml so that the editor messages appear. This commit in fact
keeps the "removing spaces" feature and enables it for all oe_structure.
Related to task-2210733
closesodoo/odoo#48463
X-original-commit: 5381e9d900b344e7d48a6b347c5fc551d433b15e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Website has a behavior that will ask you which menu you want to edit if you
click on 'Edit Menu' in the topbar and there is more than one menu in the DOM.
This is typically the case for the event pages where the event has its own menu
on top of the website one.
This event menu was not triggering that behavior since 5b563549fa where is
was accidentally broken.
closesodoo/odoo#48459
X-original-commit: 5c3c91e4a8da7b7b9f5e05f9c0ec5a6dea782d87
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
In gallery snippet in carousel mode, fix the fact that the height of
the controls are bigger that the others squares and fix also the wrong
position of the indicators.
task-2162952
closesodoo/odoo#48380
X-original-commit: 9752596abfcae6b0bbf79ac675fe9e304a068a21
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
As the container class now changes with the width option. We cannot use
this class in the js or css files anymore.
task-2162952
closesodoo/odoo#48377
X-original-commit: 1cf2ee35c2d85d87b27d5bd72c414e12fcbaf123
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Keep the same images order as the other modes in the gallery snippet
with masonry mode. Before this commit, the images order was reversed
with masonry mode.
task-2162952
closesodoo/odoo#44486
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Add position top in popup snippet and cookie bar.
Properly center content when full size and position center because
before this commit the content was at the top and not centered.
Part of https://github.com/odoo/odoo/pull/46503
task-2194309
closesodoo/odoo#46503
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Add an input field to define the value of the progress bar instead of
the previous system by mousedown. Disable animated by default.
Part of https://github.com/odoo/odoo/pull/46503
task-2194309
Copy the absolute path in the clipboard instead of the relative for
anchor links. So the link still works if it is pasted on another page.
Part of https://github.com/odoo/odoo/pull/46503
task-2194309
Removes option to move card to the right/left from the left panel
and add this option on the element overlay.
Makes the snippet responsive and other improvements.
Part of https://github.com/odoo/odoo/pull/46503
task-2194309
This commit:
- make handle_visibility a private function (even if not
exploitable in rpc easily since it uses request.website)
- encrypt the password in db (even if not critic, since this
password could be shared on twitter, ... it doesn't cost anything
to secure it a bit more)
- remove useless sudo, since handle_visibility does a sudo itself.
In the future, this notion of visibility should be handled on controller layer,
and no more on the View layer (during rendering)
closesodoo/odoo#48145
X-original-commit: 06e0e48217f25f17dff23331111f5dcb98e8cecd
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
The option was not adapted correctly to the new left panel option
system, especially: not adapted to the use of a dedicated colorpicker
widget.
Part of https://github.com/odoo/odoo/pull/45093
task-2151408
X-original-commit: 39ed330ba635af7c81f03df2fdfe4309c95e05d9
When enabling a transparent navbar on a specific page, the user can then
choose a bg color (class) to apply on the transparent navbar. That class
comes with an automatic text color... which was not correctly working
because BS4 overrides colors for nav-links.
Part of https://github.com/odoo/odoo/pull/45351
task-2151408
closesodoo/odoo#47896
X-original-commit: 2937358b63c23bd7e34da713ab4236fa340be0a9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Adaptation of the code throughout all modules to properly instantiate the newly
refactored control panel and update it accordingly.
Part of task 2196029
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Indicators were hidden in editor when switching to slideshow mode
from any other mode. Because the class of the selected mode was defined
after rendering and we need this class before the rendering. This also
fixes other small issues when switching between different modes.
Part of https://github.com/odoo/odoo/pull/44180
task-2162952
closesodoo/odoo#47519
X-original-commit: a99150b11a463901121bbe9751370231e3564ca2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before that the space between the first two links was more spaced than
the others.
Part of https://github.com/odoo/odoo/pull/44180
task-2162952
X-original-commit: baeb08da7a32b5c185c358ec6820f8a66c6edb4f
(+ gallery snippet in carousel mode)
Part of https://github.com/odoo/odoo/pull/44180
task-2162952
X-original-commit: 6237c59d607389cb0ed57694bb23b253f49805c8
This commit moves some step utils in a dedicated file and add new ones.
These steps will be very useful for the Main Flow Tour to avoid
duplicated code.
To do this, we also had to transform it into functions to allow
utils to call each other. Existing one are converted for
standardization purpose.
Note that 'WEBSITE_NEW_PAGE' wasn't considered as an util.
This is a very simple step only used twice.
No default url on countdown's urlpicker anymore. Only a placeholder.
Also redirect to homepage if no url.
Part of: https://github.com/odoo/odoo/pull/46640
task-2210358
closesodoo/odoo#47235
X-original-commit: a0d983e94e3681a3f3e55cc445defc1ec862c606
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The urlpicker was not closing properly when a value was selected.
Part of: https://github.com/odoo/odoo/pull/46640
task-2210358
X-original-commit: 6f722d919cd650d5c0b1b9c4a878fd519267c348
Previous implementation crashes randomly in chrome headless due to timeout.
Avoid to do web action, while we just want to check reset_password feature.
+ add one test that reset password on partner from website 2 to check that
link match the domauin from website 2.
closesodoo/odoo#47136
X-original-commit: d8019f25a5cd6ed611295e9b93111402f4cad04a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
5ac269d722f fixed 7e2b0ebe799 that prevented the website menu to actually be
visible, since the JS in charge of displaying the menu was 'crashing'.
A test was missing to avoid that issue to appear ever again, since it is quite
a critical problem.
Note that it might look strange that breaking such a mechanism does not make
the runbot red, but since the menus are actually considered visible, the tests
are able to 'see' it in DOM and click on it.
They are actually hidden through an opacity 0 & height 0 while the JS process
them.
task-2093679
closesodoo/odoo#47138
X-original-commit: 0dc00a252dfe7fee658579a60dc7b1b1ca71a661
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, this was done:
1) Primary variables (app order):
(a) web_editor: define palettes (color + theme + gray), only 1 empty
one. Mark the first ones as the selected ones.
(b) website: fill all defined palettes with the website-related
color key and values (body, menu, logo-height, etc).
+ define "website values" palette.
2) Secondary variables (reverse app order):
(c) website: merge the user palettes on top of the selected palettes
(so user values overriding values added in (a) and (b)),
the resulting palettes are added in palettes lists and the
selected palette numbers are set to select those ones.
+ final selection of "website values" palette.
(d) web_editor: final selection of the selected color palette amongst
the color palettes.
--
The problem with all of this is that the definition of palettes
in themes (occuring between step (b) and (c)) never received the
website-related color key and values of step (b) and were thus forced
to redefine all of those by themself even if they wanted to use the
default website one.
This commit changes the system so that step (a) and (b) now define
"base" palettes (color, theme, gray, website values) and step (c) and
(d) now merge the final selected palettes with those "base" palettes.
This is in fact theoratically more efficient and allows to not force
themes to define every possible palette value we might introduce.
closesodoo/odoo#47097
Related: odoo/design-themes#216
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Revert of old editor (35b6182) has reintroduce code invalid.
Now the data is wrapped in message (f8fe314e7)
Remove guarded that raise a warning, it is the default behavior now.
closesodoo/odoo#46870
X-original-commit: 9d3a2903fd7bf946c033ec78e959e3ed86754845
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit adds two buttons on the Theme side menu that allow users to
add custom XML to the head and to the footer of the website.
Part of #44633
task-2168391
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit:
When logged in and navigating on a frontend page, the accessible `ir.ui.menu`
would be loaded in qcontext.
Loading those menus performs alot of SQL request, up to ~2.000 requests on big
databases such as Odoo.com for an user with a lot of access rights.
This is not a problem on low traffic website as this is ORM cached, but when
there is a lot of traffic, the cache is clear very often, thus this code only
is adding a lot of requests for no reason most of the time as the user is just
navigating without any intention of opening the application menu.
Note that this qcontext computation in frontend was pointless in enterprise as
the applications menu in frontend redirect to the backend without using it.
This commit removes that computation from the qcontext. The menus will be
computed and loaded only when the user really needs it, when he is about to
open the application menu.
closesodoo/odoo#46127
X-original-commit: 471ddf85ce619961e46fb281bf721968ff298d3b
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Before d00c0e317, `Datetime` fields would be editable in frontend but would
have unexpected results, especially in non-English languages, for when the
english lang format had been changed.
It would also crash when saving non-English strings, such as `Lundi`.
For more details, see https://github.com/odoo/odoo/pull/44484#issuecomment-586850490
Since d00c0e317, only date displayed in lang format would be editable, which
case is Event page in Odoo 12.0. Everywhere else, the format is changed for a
nicer layout, either with `widget=XXX` or `t-options=YYY`, such as:
`<time t-field="record.date" t-options='{"format": "MMM d, yyyy"}'/>`
`<time t-field="record.date" t-options="{'time_only': 'true', 'format': 'short'}"/>`
When a date parsing crashes during editor save, the problem is not only that
the date can be saved, but the whole changes of the page are lost, as they
won't be saved either.
This commit attempts to fix every languages cases, regardless of the website
lang or user lang.
To do so, we store the date in the user lang format in a data attribute of
every date field in the DOM. Once the field is clicked (to edit probably),
that value will replace the one displayed according to the widget/options.
That way, dates will always be sent to the server in the user lang format,
avoiding any possible mismatch.
This whole fix apply to `Datetime` and `Date` fields.
opw-2183055
Closes#44484Closes#45555Fixes#44047closesodoo/odoo#45725closesodoo/odoo#45997
X-original-commit: c0db9bb8027ff926c619aebe6e0a5cdd05808232
Original-signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
When we edit a link on the website, the target page is loaded to find
the anchors. This occured at every typed character which was obviously
not efficient.
task-2187754
closesodoo/odoo#45831
X-original-commit: 06ae0b7b00c837733a9c67772007aee6712b246e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the previous snippet cleanup, a lot of superfluous row > col were
removed in favour of having the bare content directly in the section,
this streamlines the interface and prevents having many useless UI
elements.
At the same time however, there are some snippets on which you might
want columns so that you can pull the content off-center and give the
block a background color independently of its containing section
(namely: the cover, title and text-block snippets)
this commit adds an option to add columns on those snippets (and remove
those columns completely if they're no longer wanted)
task-2120360
closesodoo/odoo#45712
X-original-commit: a44bfc4f7bba16d700650ecc2369fa1445ecbfb9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
We recently transitioned to async option methods, this allows us to have
better control on the order of execution in the edition workflow, and
among other things, keep the editor's UI in sync with the current state
of the DOM.
However, some snippet options (such as the number of columns option)
need to remove or clone portions of the DOM, and as such, trigger the
onClone or onRemove methods of the snippets contained in that portion if
applicable. Because these methods are defined on other options, we first
need to make sure all the snippetEditors for this portion are created,
which is asynchronous.
This commit adds support for an onSuccess callback to the
'clone_snippet' and 'remove_snippet' event handlers, such that options
can choose to be notified when the work has been done, allowing them to
wait for it before proceeding.
This commit also adapts the layout_column snippet option to make use of
that new feature, and remove code that was used as a workaround before,
ie: precomputing the expected number of columns after the clone/remove,
and using that number to adjust the width of the columns and update the
UI. We can now just wait for the clone/remove, and use the real number
of columns currently in the DOM.
closesodoo/odoo#45343
X-original-commit: c159d58ce9cfca4a44f159b18eb10d1138977e23
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
d92f76592c introduced a toastr when publishing a record.
It was designed for the topbar publishing toggle button, but some other
templates ended up also using that feature.
As those templates were missing `data-description` which contains the model
business name, it would show `You've published your undefined`.
This is only related to a very few places having a publish button inside the
page.
This commit fixed that by ensuring every publish button template have the
necessary code.
Also, a fallback is added in case tha `data-description` is missing somehow.
task-2191735
closesodoo/odoo#45141
X-original-commit: 4ab6e36b739060eb16e97eac502fd087a072abf3
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
in this commit, throw the wizard to enter the new page name, while duplicating
page button and new duplicate page button added in the page properties dialog.
updated the test case related to duplicate page along with duplicate menu
consideration.
task-2088546
closes#40085
Co-authored-by: jpr-odoo <jpr@openerp.com>
Following things are done in this commit:
1. changed some labeling and string for more readable and helpful to the user
2. added extra width to the text box
3. added publish/unpublish option for mobile view.
4. track page option auto-activated for any new page,event,job offer,course,
blog.
task-2088546
closes#40085
Co-authored-by: jpr-odoo <jpr@openerp.com>
Previously, when clicking on the next post at the bottom of a blog post,
a spinning loader circle would always appear in the bottom left of the
screen in an incorrect position. This commit removes that spinner.
This commit also adds support for the half-screen cover size, which
until now would animate as though it was full screen. All in all this
just makes the transition animation much more seamless, which was the
point of having it in the first place.
task-2166790
closesodoo/odoo#44198
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website
Some dialog promises were not resolved on close, blocking the editor.
closesodoo/odoo#44953
X-original-commit: 20f97470cdc59a817526305806e94b222f26a0f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* website_form
Some technical explanations:
The method became async because the `setTarget` call which was in there
became `async` since it performed an UI update. As this method being
async is a problem with some snippets, it is best to keep it synchronous
for now. For this, the UI update in `setTarget` is removed and becomes
the responsibility of the caller. Nothing relied on it except one code,
which is solved by calling `onFocus` before the UI update which occurs
on focus, as it is already the case in master.
closesodoo/odoo#44850
X-original-commit: 53bba0660237abbcadc9675fd89ec94a2a31e130
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Normally, the number of column option adjusts the width of each column
after changing their number so that they always fit in one row. In
previous versions, the sequence of the code was correct thanks to
jQuery's deferreds executing their then callbacks synchronously if the
promise was already resolved. However, native Promise objects always
put their then callbacks in the microtask queue, and this was resulting
in the column width classes being recalculated before their number had
actually changed.
This commit fixes that by calculating the width of the columns based on
how many columns there will be after addition/removal. It also
introduces a new field on the option that is used to update the UI so
that it displays the correct number.
closesodoo/odoo#44849
X-original-commit: 58804d6ea375629b07748bc442eaccc401c56d1b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* web_editor, theme_bootswatch
Instead of having an entirely dedicated system for theme options in a
third tab of the left panel, those theme options are now simple snippet
options. See the customizeWebsite generic method.
This allows to make any option available in the third tab or on any
meaningful element like the header or the footer. This also allows to
take advantage of all the features of the left panel: dependencies,
visibility update, etc.
Note: same as before, those changes do apply the color/size/layout
immediately on the website, even if not saved. Changing that behavior
is complex and might be the job of another task.
Part of https://github.com/odoo/odoo/pull/41166
task-2088298