Commit Graph
1864 Commits
Author SHA1 Message Date
qsm-odoo 5e9ebcfb01 [FIX] web_editor: properly call on_remove method of snippet options
The snippet options can define an on_remove method which was supposed
to be called when the snippet is removed. This was not the case since
the method was written so that the options were removed before the
on_remove method was called... (Un)fortunately, the on_remove callbacks
were not doing any critical job in current implementation. In saas-13
however, some elements will rely on this.
2016-09-12 15:35:16 +02:00
Christophe Simonis 298e2032ea [MERGE] forward port branch saas-12 up to 9f28139 2016-09-09 18:13:31 +02:00
stefanorigano e1022f38a3 [IMP] web_editor, website: add colorpicker palettes customizations
* Add the ability to define palettes custom selection.
* Add the ability to define a custom title for the colorpicker dropdown
* Define a custom layout for single (unique) palette layout

* Define overlay color options based on new colopicker for
Cover and Banner text containers

* Define default palettes
2016-09-07 13:00:01 +02:00
stefanorigano 5b8c93f073 [IMP] web_editor: change design of transparent colors palette
* Add a "transparent" button
* Add a special background for transparent background buttons

+ Some minor colorpicker design change
2016-09-07 12:58:50 +02:00
qsm-odoo fa3f529d80 [FIX] web_editor: stop resetting bg image of parent snippet on color change
Commit 404ed0f788 tried to solve the
problem but only solved a part of it. Indeed, if the snippet child
has a bg color option but not a bg image option, the event propagation
stops in the parent handler, when it is too late.

Solution is checking that the event comes from the same element on
which the callback is attached to.
2016-09-06 13:00:56 +02:00
qsm-odoo 61e48b09fb [REF] mass_mailing: convert templates to themes and clean code
* Remove mass mailing template switching system (lemon, airmail, ...)
and replace it with a theme selector which only toggle a different
class on the body.
* Lint JS files.
* Change the way the editor is overridden by mass_mailing in a more
odoo way (put the JS in assets and check on runtime if it must be
applied.

+ fix editor style
+ remove useless code
+ remove odoo template
2016-09-05 17:07:31 +01:00
Csaba Fazekas 9676ceec02 [REF] mass_mailing: change/add snippets/themes layout/design
* Airmail/Lemon/Tech template/Odoo template
* Add bg color option
* Clean snippets
2016-09-05 17:01:50 +01:00
Christophe Matthieu 1501b30c53 [REF] mass_mailing: change theme/template selection and add new snippets
* remove theme/template selection screen for mass_mailing
* allow to use different layout on edition
* add new snippets
2016-09-05 17:00:45 +01:00
Christophe Matthieu ea8f29e260 [FIX] web_editor: debug mode is not applied in the iframe of html field 2016-09-05 17:00:33 +01:00
Christophe Matthieu 0cca5651a5 [FIX] web_editor: saved mass_mailing have small difference with edition 2016-09-05 17:00:09 +01:00
Christophe Matthieu 8fc60d3509 [FIX] web_editor: display fullscreen button in readonly mode 2016-09-05 17:00:02 +01:00
Christophe Simonis 1a77d9d02a [MERGE] forward port branch saas-12 up to 476cb5a0 2016-09-03 23:57:57 +02:00
Christophe Simonis 55d2e4b7cf [MERGE] forward port branch saas-11 up to bde7f88 2016-09-02 17:23:34 +02:00
qsm-odoo c227b8fd88 [FIX] web_editor: remove some defaults in text edition
* On firefox, you had to click twice on a link to be able to start
typing text
* When selecting text which contained a <br/>, you were not able to
replacing it correctly (you had to click again before starting typing)
* When replacing a whole paragraph content which was below a title,
the text was not replaced and you had to click again and the title
transformed into a paragraph.
* ...
2016-09-02 10:04:58 +01:00
qsm-odoo 8c0c308eca [FIX] web_editor: correct return value of saveElement 2016-09-02 10:04:58 +01:00
qsm-odoo 5a71cc6bdc [REF] web_editor: lint and simplify JS code 2016-09-02 10:04:57 +01:00
Martin Geubelle e59a7fe3ff [REF] web_editor, website: move ACE editor to web_editor 2016-09-01 17:15:01 +02:00
stefanorigano 8c035a7a41 [IMP] web_editor: add transparent grayscale color palette
These colors were usually hardcoded in some snippets (.s_banner for
example) to increase text legibility over background images.

This commit will let the user personalize them.
2016-08-31 16:37:20 +02:00
stefanorigano 1634cad46c [REF] web_editor: editor UI style and stability improvements
* Review style of some UI components
* Rename some content
* Define a font-family less variable to be used to avoid that themes
customizations affect the UI. Note: theme should ideally not redefine
the font family of the body but of the #wrapwrap element but this is
done for safety.
* Overwrite other theme's customisations
* Minor style fixes
2016-08-31 16:37:20 +02:00
qsm-odoo 4d68d779dc [IMP] web_editor: force web_editor overlay option buttons to stay on one line
Before this commit, when the snippet was too narrow, the buttons broke
over multiple lines.
2016-08-31 16:37:20 +02:00
qsm-odoo d6f30345a3 [IMP] web_editor,website: rename "background image options" option
"Background Image Options" -> "Background Image Sizing"
2016-08-31 16:37:20 +02:00
qsm-odoo a7f7efac4c [IMP] web_editor: improve usability to select image in media dialog
Before this commit, we had to click on the image we want, then click
on save in the modal footer. Now we can also double click on the image
we want, with the same result.

Same goes for icons.
2016-08-31 16:37:20 +02:00
qsm-odoo 0659d94d7f [IMP] web_editor: open link dialog on double click on a link
(Also refactore the code so that the implementation is the same for
the media dialog opening on double click on an image).
2016-08-31 16:37:20 +02:00
qsm-odoo 323c949ec4 [IMP] web_editor: lint file rte.summernote.js 2016-08-31 16:37:20 +02:00
qsm-odoo 0305de1929 [IMP] web_editor: change tooltip for parent button in editor
"Select Container Block" -> "Select Parent Container"
2016-08-31 16:37:20 +02:00
qsm-odoo 404ed0f788 [FIX] web_editor: do not propagate event communication between
background and color snippet options

The background and color snippet options communicate so that if a
color is set while a background is already set, the backgrond is
removed. The problem is that the event propagation was not stop
so if a snippet had a background and one of its child set a color,
the background was removed.
2016-08-31 15:28:15 +02:00
Christophe Matthieu 0f8f68dfa7 [IMP] web_editor: convert tours to use web_tour.tour 2016-08-30 13:54:28 +02:00
qsm-odoo c69f306b5d [FIX] web_editor: correctly display image and focus point in bg option dialog
Before this commit, the focus point the user can move on the image in
the background position configuration dialog was only following the
mouse as we want if the image original width was larger than the dialog
one. This is because the javascript relies on the fact the image takes
100% width of its container. To fix this, the container now does not
take 100% of modal width but the size of its internal image (with a
max-width of 100%).
2016-08-30 10:04:14 +02:00
qsm-odoo 88d8a2ca8e [FIX] web_editor: hide header in customize dropdown when it has no content
In some snippets, the parent hierarchy has many elements. So, when
selecting a deep child of one of those, the customize dropdown had
many dropdown headers showing the parent hierarchy but without any
option for many of them.

Commit de0d9fd666 already fixed the case
where the dropdown only contains dropdown headers. This commit is an
adaptation to hide these headers one by one.
2016-08-29 18:50:51 +02:00
qsm-odoo ca01e7d7c5 [FIX] web_editor: change margin and resize handle icons on focus
The feature was lost because of a programmation error (use of this in
a non-binded function).
2016-08-29 18:50:51 +02:00
Christophe Simonis f4738e7bb5 [MERGE] forward port branch saas-12 up to 78e9c7f 2016-08-26 18:06:17 +02:00
Christophe Simonis de0d503421 [MERGE] forward port branch saas-11 up to f0c8224 2016-08-26 16:59:45 +02:00
Christophe Simonis 5c2025a3af [MERGE] forward port branch 9.0 up to c578fb7 2016-08-25 18:23:47 +02:00
qsm-odoo 57246814e9 [FIX] web_editor: properly bind event to the editor style dropdown
Before this commit, the callback which selects the currently used
style in the dropdown menu was binded to the mousedown event on the
div which contains the dropdown-toggle and the dropdown-menu. This
was wrong as the callback is thus called even when clicking in the
dropdown menu.
2016-08-25 13:14:42 +02:00
Christophe Simonis 9ad5f26b3f [MERGE] forward port branch saas-11 up to 3a2147d 2016-08-20 17:18:31 +02:00
qsm-odoo b4cfe36b05 [IMP] *: replace snippet sections menu by a title
* web_editor, website, mass_mailing

This menu allowed to scroll to the snippets sections by clicking on
their corresponding icons. It was useless as the sections are not
taking a lot of height. This also appeared buggy as clicking on the
last icon highlighted only the second one as this second one was still
the first section visible on the screen when the last section was
fully visible.

This also added fours buttons to the interface which contains already a
lot of them. Now this is replaced by a title "Add blocks" which makes
the editor cleaner and also improved the performance to enter the edit
mode.
2016-08-19 17:44:28 +02:00
qsm-odoo cc2cd9108c [IMP] web_editor: put the "Quote" style after "Header" styles 2016-08-19 17:44:28 +02:00
qsm-odoo f196afc80b [IMP] web_editor: come back to a more regular summernote colorpicker
Splitting the summernote colorpicker into bg colorpicker and foreground
colorpicker seems to have been a bad idea as people tend to click on
the recent color button thinking it will open a dropdown.

This commit keeps the design that had been decided for colorpicker
template and do not change the "background-color" snippet option.
However, the colors for background and foreground text changes are
now displayed in an unique dropdown again, with reviewed style.

+ adapt the rte tour
2016-08-19 17:44:27 +02:00
qsm-odoo 0ab08050b9 [FIX] web_editor,website: stop closing web_editor dialog two times
This commit fixes two problems:

* Clicking on the save button of a web_editor dialog closed the dialog
two times because the button was created with the flag "close: true"
and binded to a handler which closes the dialog. This also prevented
to extend this handler by placing the this._super call in a deferred.

* Some web_editor dialog extended the save callback but forgot to use
the this._super, which prevents the "saved" event to be triggered
(currently not used anywhere but useful for custo and master).
2016-08-19 17:44:27 +02:00
qsm-odoo 9c07b67d10 [FIX] web_editor: visibility of customize snippet option button
Commit 57c09e8a8e was supposed to fix the problem but only made it
worse in some cases. Since the new option parenting system, the
customize button visibility should not be determined on creation as
parent and own options are appended on snippet focus. Also, removing
the dropdown header if it was alone was a bad idea as this is it which
contains the information of options and all the options have not
necessarily a <li/> tag in the dropdown.

For example, the many2one option has no <li/> in the dropdown and is
the only option of the field snippet. So with the previous commit, the
dropdown header was removed as there is no <li/> in the dropdown other
than this header. So as the header was removed, on snippet focus, there
was no way to determine the many2one option exists, so its on_focus
method was not called.

Now, the dropdown-header is always kept. The visibility of customize
button is determine on snippet focus.
2016-08-19 17:44:27 +02:00
qsm-odoo ff9a9d703f [FIX] web_editor: properly handle many2one fields
The many2one fields and their search bar were not working anymore since
the loss of some functionnalities with commit b309f3ab54.

* The dropdown which regroups a snippet options list is hidden if it
does not contain any option. This was not the case anymore because it
now always contains a dropdown title. This is fixed by simply removing
this title if it is alone in the dropdown.

* Snippet options attached to an element whose parent is not editable
cannot be moved/deleted/duplicated as it is supposed to remain where
it is. This is often the case for many2one fields and the feature was
simply lost in the refactoring.
2016-08-19 17:44:27 +02:00
qsm-odoo 3049b154e9 [FIX] web_editor: paragraph dropdown style
Before commit a8ee18e172, the paragraph alignment dropdown menu was
too large for its content, so it was ugly. After that commit, it became
too small for its content, which is even more ugly.

This fix sets the width of this specific dropdown so that its content
fills exactly in (as with original summernote).
2016-08-19 17:44:26 +02:00
qsm-odoo f3d8ede492 [FIX] web_editor: make save/discard btns visible when too many options
The editor bar is sometimes filled with too many options, and these
hide the save and discard buttons on small screens. To solve the
problem, the description option (which take a lot of space) has now
a max-width and the save and discard buttons are always on top.
2016-08-19 17:44:26 +02:00
Damien Bouvy d7939282e9 [FIX] mass_mailing: avoid too long URIs by blacklisting fields in editor call
The call to the web_editor is made through an iframe with some get
parameters. While not really a problem in itself, this has the
disadvantage of generating long URIs. In some case, since all the
fields in the views are included as a GET parameter, URIs can be
generated that go up to several thousand characters. Most servers will
return a 414 for such URIs, preventing the edition of the mail
template in the view.

To avoid this problem, this commit extends the 'html_frame' widget and
blacklist 2 fields that can get too long once encoded.

Ideally, it would probably be better to stop sending all the fields and
simply add the *needed* fields one by one, but since it's difficult to
know exactly what fields might be needed and this is stable, I'm gonna
go with this 'workaround' but conservative fix.

opw-685646
2016-08-19 17:13:34 +02:00
qsm-odoo 7a77209149 [FIX] web_editor,website: stop closing web_editor dialog two times
This commit fixes two problems:

* Clicking on the save button of a web_editor dialog closed the dialog
two times because the button was created with the flag "close: true"
and binded to a handler which closes the dialog. This also prevented
to extend this handler by placing the this._super call in a deferred.

* Some web_editor dialog extended the save callback but forgot to use
the this._super, which prevents the "saved" event to be triggered
(currently not used anywhere but useful for custo and master).
2016-08-19 09:07:40 +02:00
qsm-odoo de0d9fd666 [FIX] web_editor: visibility of customize snippet option button
Commit 57c09e8a8e was supposed to fix the problem but only made it
worse in some cases. Since the new option parenting system, the
customize button visibility should not be determined on creation as
parent and own options are appended on snippet focus. Also, removing
the dropdown header if it was alone was a bad idea as this is it which
contains the information of options and all the options have not
necessarily a <li/> tag in the dropdown.

For example, the many2one option has no <li/> in the dropdown and is
the only option of the field snippet. So with the previous commit, the
dropdown header was removed as there is no <li/> in the dropdown other
than this header. So as the header was removed, on snippet focus, there
was no way to determine the many2one option exists, so its on_focus
method was not called.

Now, the dropdown-header is always kept. The visibility of customize
button is determine on snippet focus.
2016-08-12 16:09:57 +02:00
qsm-odoo 369bcf610c [FIX] web_editor: paragraph dropdown style
Before commit a8ee18e172, the paragraph alignment dropdown menu was
too large for its content, so it was ugly. After that commit, it became
too small for its content, which is even more ugly.

This fix sets the width of this specific dropdown so that its content
fills exactly in (as with original summernote).
2016-08-10 11:30:33 +02:00
qsm-odoo 57c09e8a8e [FIX] web_editor: properly handle many2one fields
The many2one fields and their search bar were not working anymore since
the loss of some functionnalities with commit b309f3ab54.

* The dropdown which regroups a snippet options list is hidden if it
does not contain any option. This was not the case anymore because it
now always contains a dropdown title. This is fixed by simply removing
this title if it is alone in the dropdown.

* Snippet options attached to an element whose parent is not editable
cannot be moved/deleted/duplicated as it is supposed to remain where
it is. This is often the case for many2one fields and the feature was
simply lost in the refactoring.
2016-08-05 15:13:54 +02:00
qsm-odoo a8ee18e172 [FIX] web_editor: make save/discard btns visible when too many options
The editor bar is sometimes filled with too many options, and these
hide the save and discard buttons on small screens. To solve the
problem, the description option (which take a lot of space) has now
a max-width and the save and discard buttons are always on top.
2016-08-05 11:55:00 +02:00
Christophe Simonis c956075f5f [MERGE] forward port branch 9.0 up to cadb481 2016-08-03 15:07:24 +02:00