Commit Graph
713 Commits
Author SHA1 Message Date
Christophe Simonis 845f4ef7d3 [MERGE] forward port branch saas-11.2 up to 8a7b845353 2018-03-23 10:31:00 +01:00
Christophe Simonis cdbee48888 [MERGE] forward port branch 11.0 up to 39d9c362c5 2018-03-22 20:05:14 +01:00
Romain Derie f5912cbcb3 [IMP] website: make it more noticeable when a page is unpublished
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
2018-03-22 16:32:51 +01:00
Romain Derie 744af2db60 [FIX] web_editor: correctly set image on double click
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)
2018-03-22 14:38:17 +01:00
Christophe Simonis 76027a6e12 [MERGE] forward port branch saas-11.2 up to 6773bdbe32 2018-03-21 19:42:34 +01:00
Pratima Gupta 9239ec7de8 [FIX] web_editor: set correct zindex on translation navbar
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
2018-03-21 19:09:51 +01:00
Romain Derie 321486851a [FIX] web_editor: correctly set image on double click
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
2018-03-21 14:18:45 +01:00
Christophe Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Nicolas Lempereur 7f216f62b6 [FIX] web_editor: modal fullscreen is fullscreen
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
2018-03-15 17:12:57 +01:00
Géry Debongnie 64d47c0bc5 [IMP] update ace editor to v1.3.1
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.
2018-03-14 09:02:16 +01:00
Aaron Bohy 61f64c0166 [FIX] web_editor: FieldHTML: break long words
to prevent them from overflowing the form sheet.
2018-03-13 12:51:44 +01:00
Darshan Kalola 2b392636c4 [FIX] web_editor: rpc of 'many2one' snippet option
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
2018-03-13 11:37:59 +01:00
Romain Derie f02cd2977e [FIX] website: use user timezone when handling date in page property
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
2018-03-12 12:06:55 +01:00
Christophe Simonis 0f57bdba72 [MERGE] forward port branch saas-11.2 up to 42659dc70c 2018-03-09 16:25:58 +01:00
Christophe Simonis d67b410dfc [MERGE] forward port branch saas-15 up to cb87388d72 2018-03-07 17:42:02 +01:00
Christophe Simonis 7c708bc004 [MERGE] forward port branch saas-14 up to df3c33111e 2018-03-05 12:50:58 +01:00
Christophe Simonis df3c33111e [MERGE] forward port branch 10.0 up to 554afff3ac 2018-03-05 10:45:53 +01:00
Jeremy Kersten 5ad278ac08 [FIX] web_editor: show 'open in new window' on link edit
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
2018-03-02 11:56:07 +01:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Christophe Matthieu b9a763ba3c [FIX] web_editor: avoid unnecessary slowdown of the web client
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.
2018-02-28 11:55:20 +01:00
qsm-odoo c254c4c684 [FIX] web_editor: stop crashing on applying fonts with standalone summernote
Commit https://github.com/odoo/odoo/commit/137c4f5d76b55c3dd3c4f593de484aadfcf5e6da?w=1#diff-6a334b274d95fb88a4fbc29b910fbb59R2120
introduced a bug as it is using a function which is defined in another
asset. This is fine for connected users but not for summernote-only
users like public users on the forum.

The reason the line was introduced is unsure so it is simply removed for
now. The bug it was supposed to fix will be fixed later if it ever needs
to be.
2018-02-26 12:58:28 +01:00
Christophe Simonis d4a67bbcf4 [FIX] web_editor: do not try to expose non existant widgets 2018-02-22 11:43:21 +01:00
Christophe Simonis 9a84ba5533 [MERGE] forward port branch saas-11.1 up to e750bb6e11 2018-02-22 10:39:15 +01:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Christophe Simonis dbb713c2f8 [MERGE] forward port branch saas-16 up to 49f8548557 2018-02-21 19:17:01 +01:00
Christophe Simonis 49f8548557 [MERGE] forward port branch saas-15 up to 085ff2f9c4 2018-02-21 18:36:36 +01:00
Christophe Simonis 085ff2f9c4 [MERGE] forward port branch saas-14 up to 8c692aac88 2018-02-21 18:09:17 +01:00
Christophe Simonis eebc7b6e32 [MERGE] forward port branch 10.0 up to 1512618d3e 2018-02-21 12:42:46 +01:00
Jairo Llopis dd184b26ac [FIX] web_editor: Export classes and methods
Add various classes and methods to allow customization

Closes #23180
2018-02-21 11:50:57 +01:00
Christophe Simonis 1512618d3e [MERGE] forward port branch 9.0 up to e544ec8df7 2018-02-21 11:27:22 +01:00
Martin Trigaux ed62588318 [FIX] web_editor: correct frenglish
Courtesy of e2f translators
2018-02-20 16:24:23 +01:00
Romain Derie bcc088c348 [FIX] web, web_editor: Better email validation with regex (JS)
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 @​.
2018-02-20 12:30:13 +01:00
Nicolas Lempereur 64be3521ce [FIX] web_editor: don't format xml with script tag
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
2018-02-20 12:25:54 +01:00
Christophe Simonis 3b959c313d [MERGE] forward port branch saas-11.1 up to a277b58507 2018-02-15 11:52:10 +01:00
Christophe Simonis a277b58507 [MERGE] forward port branch 11.0 up to 259686ba78 2018-02-15 10:58:08 +01:00
Christophe Simonis 72508cc241 [MERGE] forward port branch saas-16 up to 7792755946 2018-02-14 18:26:57 +01:00
Christophe Simonis 7792755946 [MERGE] forward port branch saas-15 up to d24bdbde81 2018-02-14 17:18:59 +01:00
Christophe Simonis d24bdbde81 [MERGE] forward port branch saas-14 up to 9d0de61114 2018-02-14 16:34:13 +01:00
Christophe Simonis 9d0de61114 [MERGE] forward port branch 10.0 up to 73c2ac451a 2018-02-14 16:04:23 +01:00
Christophe Simonis 19a37782fb [MERGE] forward port branch 9.0 up to 2d73ea9bed 2018-02-13 19:02:37 +01:00
qsm-odoo 5e6c5d24be [FIX] mass_mailing, *: duplicating two-columns snippets
* 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
2018-02-13 14:19:07 +01:00
qsm-odoo 32bdadad13 [FIX] web_editor, mass_mailing: better transcode alignment inheritance
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
2018-02-13 13:37:50 +01:00
Nicolas Lempereur a6e66131ce [FIX] web_editor: error on cross domain stylesheet
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
2018-02-12 18:21:00 +01:00
Christophe Simonis 0f02dcb639 [MERGE] forward port branch saas-11.1 up to c69d00157e 2018-02-12 18:08:27 +01:00
Alexandre Kühn 0de5c1f076 [FIX] web{_site,_editor}: transparent root instance 'root widget'
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.
2018-02-12 16:09:37 +01:00
Christophe Simonis c69d00157e [MERGE] forward port branch 11.0 up to 169f899e29 2018-02-12 13:15:06 +01:00
Nicolas Lempereur 1c5bb8564b [FIX] web_editor: regression less editor 5af122387
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
2018-02-12 11:57:39 +01:00
Christophe Simonis 5f3301e5cb [MERGE] forward port branch 11.0 up to 20e4cd5bcd 2018-02-09 16:13:08 +01:00
Christophe Simonis 4b43803dc6 [MERGE] forward port branch saas-16 up to e2ae51c4b0 2018-02-09 15:02:31 +01:00