Before this commit, 2 usability issues were reported:
1. Some people would get stuck with unpublished content without even knowing it
since they would not understand the page is unpublished.
2. People would have a hard time finding the publish button (small toggle on
the navbar).
Now:
1. We now display a red ribbon on the top right corner specifying the page is
unpublished. Hopefully it can't be missed.
2. This publish button will be more visible for unpublished content since it
will be red (danger) color. Hopefully people will notice it at first look.
Note: It is implemented in a generic way so any 'o_switch' can be turned
into this version by simply adding the 'o_switch_danger' class to it.
task-44005
Closes#23282
Commit 321486851a fixed double click on media dialog when multiple selection is
allowed.
Still, it needs a deeper fix to ensure that the image is/remains selected when
double clicking no matter it's state (selected or not) before the clicks.
Double click should always force the image to be selected before saving.
Step to reproduce:
- Drop the Image Gallery snippet
- Open new images manager (Customize > Add images or Add Images directly if no
images set yet
- Select an image (simple click)
- Now double click on it
It won't set the image since when double clicking, it:
1. Unselected the image on the first click (click event)
2. Selected the image on the second click (click event)
3. Unselected the image and saved (dblclick event)
Commit c06f0f3a35 changed the base navbar zindex.
But the navbar of the translation mode still had old zindex values making the
navbar invisible, in fact under the base navbar.
task-1804662
Commit e011d58bee add the possibility to unselect images on the media dialog.
But it introduced a collateral bug preventing double click to set the image.
Indeed, double click event triggers not only the double click event but also
twice the single click event.
Before commit e011d58bee, it would work fine and as intented on double click:
1. It would trigger twice the single click, selecting twice the image.
2. Then, it would trigger the double click that would save the selected image.
But after the commit:
1. It triggers twice the single click, selecting and then deselecting the image.
2. Then, it triggers the double click that saves nothing since the image got
unselected on second single click event.
Now, before saving on double click event, we select the image.
task-1815165
Depending on CSS surrounding the editor, the fullscreen component could
fail to set the editor fullscreen.
eg. if the editor is in a modal in a modal (ie. when editing a mail
template when adding an activity and creating a marketing automation
campaign) the fullscreen function would set it to 184px height away 30px
to the screen top.
With this change, `transform` css property is unset on parent elements
of the editor, this was causing the absolute editor to have an offset
parent that was not the body tag.
opw-1824605
closes#23682
Note that we do not do a custom build anymore, since we lazyload the
files anyway. A custom build will save a few kb, but will not do any
meaningful change to the user experience. However, it dies impact
negatively our ease of maintenance, so standard build it is.
Before this commit, changing the value of a many2one field on the
frontend was not possible anymore since 11.0 because the RPC 'order'
parameter was not properly formatted with the new conventions.
See task-1767802
Closes https://github.com/odoo/odoo/pull/23545
Before this commit:
1. The date would be displayed as UTC regardless of the user timezone.
2. The date would be sent to the backend in the browser timezone
Now we correctly take the user timezone into consideration when handling date.
Step to reproduce:
- Install a second language where time format is: %H.%M.%S or %H,%M,%S
(eg: Finnish, Bulgarian, Albanian )
- Set it as website default's language
- Open page properties dialog on any page
- The date looks correctly displayed but it is in fact the UTC hour and not
the user timezone date. (eg: 2 hours missing in Albanian case, it would
show '2018-Pri-05 02.11.02.' instead of '2018-Pri-05 04.11.02.')
- If you save, it will crash since it will send the wrong date format to the
backend that is expecting 'YYYY-MM-DD HH:MM:SS' format.
Closes#23500, closes#23566
Before this commit, when a user open an existing link in the editor
he cannot check/uncheck the option "Open in new Window" while he don't
update the url.
The field was hidden while keyup was not called.
After this commit, if the url contains a url, we show directly the checkbox.
This commit fixes opw-1819601
create range method slow down all the web client because the handler who
use this method it's in the module (not in the widget method) and called
for each click and keyup. We need only this handler for the iframe or the
website, used by the rte.
This commit improves link creation in web editor.
Before this commit, anything with a @ would be considered as valid email which
is obviously not the case. It would then be prefixed by 'mailto:'.
This was causing 2 issues:
- URL with @ symbol in it would have 'mailto:' added as prefix, like google
maps coordinates.
eg: mailto:http://www.google.com/maps/whatever/@312211.22,321321
- Incorrect emails would go through (eg: @@@, ko@k@k@, mail@mail)
Now, we will try to detect and identify valid emails from invalid emails from
URLs. It will also handle 'mailto:' directly typed in the input.
This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859
This closes#11984, closes#22936
Note that there is a WIP in master to use this new is_email function
everywhere we try to validate emails. It will aim to uniformize email
validation in odoo's javascript that are often performed with different mean
here and there, some more permissive than others, some only checking for @.
It happens from time to time that someone use "Format" on the
web.layout template. Thus:
```
<script type="text/javascript">
var odoo = {
csrf_token: "<t t-esc="request.csrf_token(None)"/>",
};
</script>
```
becomes:
```
<script type="text/javascript">
var odoo = {
csrf_token: "
<t t-esc="request.csrf_token(None)"/>",
};
</script>
```
breaking a number of things on the frontend and everything on the
backend.
On a pure javascript content, we could wrap it with:
```
//<![CDATA[
/* javascript content */
//]]>
```
but in this instance we still want the xml to be processed.
This commit avoids formatting XML containing a script tag.
opw-815865
closes#23164
* web_editor, website
This commit fixes a bug with table duplication in mailing template:
- Click on a snippet with two columns
- Duplicate it
-> the snippet is duplicated but the two columns are transformed in two
rows.
This was because there is an implemented behavior for column
duplication: if we duplicate a column which was alone on its row, we
duplicate the row instead. This code should however be triggered when
duplicating the column alone to be working, not the snippet that
contains it.
Note: this required a backport of a33ec972ab
which was fixing a non-critical "bug" for 11.0. This non-critical "bug" is
therefor fixed here too.
opw-807105
Browsers' default alignement of <td/> is 'inherit'. Some mail clients do
not set this value properly though and even if it is explicitely set,
they do not compute the final value well.
As a fix, this commit forces the 'inherit' value on <td/> and computes
the real alignment for 'inherit' values when transcoding.
opw-813688
On latest chromium (as of version 64), accessing rules of a stylesheet
is forbidden for cross-domain.
This commit catch and ignores the error when that happened.
chromium commit: https://chromium.googlesource.com/chromium/src/+/a4ebe08c91
opw-813480
opw-815860
closes#23009
With this commit, any component that needs an instance of the
root widget can simply require the module 'root.widget'. Based on
the context (backend, frontend, iframe), the real root.widget
will resolve to either the webclient, the website root instance, or
the iframe root instance.
This is desirable in order for the tour_manager to become a child
of the root widget, as tours are enabled in any of the above contexts.
This commit is a requirement in order to solve an issue with JS services,
in which there should be only one service provider at any given time.
In 5af12238 a change was made to have the correct hierarchy levels, but
this can cause an issue when editing less files.
This is because we now had "undefined + 1" which gives NaN which breaks
Array constructor.
opw-814579
opw-815397
opw-814322
opw-815265
opw-814021
closes#23006