Commit Graph
221 Commits
Author SHA1 Message Date
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
fwi-odoo a32c1d3c8d [MIG] web_editor: migrate to new api 2016-08-03 13:42:25 +02:00
Christophe Simonis b457f15c45 [MERGE] forward port branch saas-12 up to 285f6bd 2016-07-30 13:05:04 +02:00
Christophe Simonis 285f6bd114 [MERGE] forward port branch saas-11 up to 65a67ce 2016-07-30 13:04:39 +02:00
Christophe Simonis 09e943429e [FIX] website_sale: unable to edit product price
The less refactoring in 5b65befcd8
wrongly removed the css directive that hide some elements in edit mode.

As a side effect, the product price was appearing twice when editing a
product. Commit 44ca4317a9 tempt to fix
it but removed the edition part.

opw:683343
2016-07-30 12:43:21 +02:00
Christophe Simonis 523d3af131 [MERGE] forward port branch saas-12 up to 16d65a8 2016-07-29 17:55:21 +02:00
Christophe Simonis f670b3b1df [MERGE] forward port branch saas-11 up to 3aea814 2016-07-29 15:33:51 +02:00
Christophe Simonis cfb0c0dead [MERGE] forward port branch saas-11 up to 7ae5121 2016-07-25 17:17:15 +02:00
qsm-odoo 28ac3a369f [FIX] web_editor: secure the paddings of btn in the editor
Prevent the padding of editor .btn's to change when a theme modifies
them (by mistake or not).

Once again, this is a problem of css isolation between the editor and
the website customization. A theme cannot safely, at this time, do
"#wrapwrap .btn" to isolate its rules because it may override some
bootstrap rules like ".btn-group .btn" which would became less
important. It cannot changes the bootstrap variables either as it is
still used by the odoo ui in some places.
There is no safe good solution to "share" bootstrap theming between
odoo ui and website ui. The safest solution is to force the design
of odoo ui elements that may be overridden by themes (in the end,
it's the same as progressively removing bootstrap from odoo ui).
2016-07-25 17:00:24 +02:00
qsm-odoo 3fe3f55cf5 [FIX] web_editor: allow adding options on predefined bg classes
The editor allows using background image options on snippets which
use a background-image. For this to work, the oe_img_bg css class
has to be on this snippet. The problem is that the class is absent
when using some themes as the select_class method removes it to place
its own value.

Now, the oe_img_bg class is (re)added when a select_class method is
used within the background image option.
2016-07-25 17:00:24 +02:00
Christophe Simonis fc0f023053 [MERGE] forward port branch 9.0 up to 1089dcf 2016-07-25 15:07:47 +02:00
qsm-odoo f0620a9648 [FIX] web_editor,website: allow creating pages from edit menu
The code for page creation from menu edition dialog was there but
invisible to the user because of a wrong qweb template inheritance.
Indeed, the edit menu dialog relies on an extension of the link dialog
template. But this one is extended in-place in another location and
that extension is not considered when the second extension is made
because a t-extend always use the base template. The only solution to
achieve the same result is to copy the edit menu dialog qweb extension
in Javascript.

Note: the feature was still available from the link dialog in page
edition though because this was not concerned by the wrong qweb
extension.

However, adding a page by this way would create multiple pages because
one was created each time a page name was entered (and not only on
save !). So typing "test", then changing its mind and typing "hello",
then rechanging to "test", then hitting the save button created the
"test, "test-1", "test-2" and "hello" pages.
This fix takes advantage of an already present parameter which can
determine if a new page should be created or not. However, a code
refactoring should be done in master for these classes.
2016-07-20 15:59:53 +02:00
qsm-odoo e01cb8f717 [FIX] web_editor: prevent adding snippets by mistake
* Start dragging after the mouse move of some distance
* Cancel drop if the user drops a snippet in the snippet bar
2016-07-19 11:55:02 +02:00
Fabien Pinckaers 9fbe082b2b [IMP] web_editor: css regular spacing between <p> to avoid bad layout
for email previews (e.g. sale order)
[IMP] improved email template for SO, with added signature
2016-07-17 01:02:06 +02:00
qsm-odoo 73898ccb8b [IMP] web_editor: change image edition toolbar
* Move description button at the end of the toolbar
* Add an "auto" state button for the image width (alongside 100%,
50% and 25%) (when these last three are unchecked, the auto button
becomes checked).
2016-07-05 18:05:24 +02:00
qsm-odoo c259b38ef5 [IMP] web_editor: background + color snippet options
Now, when choosing a background-color when a background-image has
already been selected, the background image is removed on hover/click
of the color option.
However, the opposite operation remains the same. So if you choose a
background-color, you can then choose a background-image and the
colors will be kept.
2016-07-05 18:05:24 +02:00
Simon Lejeune eed7fdb6fe [REF] web_editor: cancel method of RTE should be async
and return its deferred. This commit makes the behavior consistent with
the `save` method.
2016-07-05 17:44:56 +02:00
qsm-odoo 36f31306e5 [IMP] website(_*): adapt tours
Adapt tours according to website/web_editor DOM changes.
2016-07-04 17:24:00 +02:00
qsm-odoo 821d2edf04 [IMP] website,web_editor: snippet option li icons
+ Some content changes
2016-07-04 17:24:00 +02:00
qsm-odoo c12f2cd5cc [REF] web_editor,website(_*): snippets
Refactor snippet structure
* new "cover" snippet
* move the title out of col-md-12
* delete snippets (s_quote_slider)
* rename snippets (FAQ Roller -> Accordion)
* ...

Refactor the way the background images are handled so that themes
can customize the defaults ones easily without ugly xpath or ugly
css.
2016-07-04 17:24:00 +02:00
qsm-odoo b309f3ab54 [IMP] web_editor,website: snippet options (parent & deletion)
* Always allow to delete a part (and delete parent if empty)
* Show parent options (by displaying the snippet name if any,
"column" for col-* and "Block" otherwise)
* ...
2016-07-04 17:23:59 +02:00
qsm-odoo 05d064f855 [IMP] website,web_editor: review style / content
* Mobile preview dialog
* Add page dialog (allow to click anywhere to close the modal)
* Change label for "auto resize" and "resize" options to "auto size"
and "fixed size" and add a checkmark to the currently active one
* Overlay border / Options dialog content
* Hide the odoo navbar after a delay when the editor starts
2016-07-04 17:23:59 +02:00
qsm-odoo 906875fc78 [IMP] web_editor: user text copy/paste
Users copy/past text from various king of document into the editor.
These texts contain useless line breaks that should be removed before
pasting. Also, the editor currently add a paragraph element between
each line.

To correct this behaviour the onPaste callback of the summernote lib
is used. However for some reason, this is triggered after the text
is pasted (we should update and refactor the lib in a better way).
So this commit uses a hack: undo the past thanks to the undo command
then paste the formatted text we want.
2016-07-04 17:23:59 +02:00
qsm-odoo 62fb1bb924 [REF] web_editor: code refactoring and simplification
* Remove dead code + optimization
* Use Dialog API from web module
* Reorganize files
* Correct buggy $() function for snippet option class
* Add comments

* Fix the snippet parent navigation :

If a page contained a three level snippet structure (i.e A contains
B contains C), when editing the following bug occured :

If B or C was selected first, parenting buttons were correctly set.
But if selecting A then C, clicking on the parent lead to going back
on A instead of going on B.

* Fix snippet thumbnail layout
* Better isolate ui css from themes
* MediaDialog image list : prevent displaying empty attachments
* ...
2016-07-04 17:23:59 +02:00
Christophe Matthieu 025263d3bf Revert "[FIX] web_editor: test jinja content to load editor in codeview"
This reverts commit f38f8930f0.

Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
2016-06-23 11:45:17 +02:00
Simon Lejeune 314a680ab4 [FIX] web_editor: save method of RTE is async
So if you include this method without returning the deferred, weird
things happen and i lose a lot of time.
2016-06-22 17:56:22 +02:00
Christophe Matthieu f38f8930f0 [FIX] web_editor: test jinja content to load editor in codeview
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
2016-06-22 14:26:42 +02:00
Christophe Matthieu 7ede9bcb2d [IMP] base ir.qweb: compile template (and use ast) to improve rendering speed
* The compiled templates are cached per user, lang, inherit context values
* ir.ui.fields: attributes method return an dict, and record_to_html return only the content value of the field
* all rendered text use build_text and all attributes use build_attribute
* t-esc-options is removed and replace by format_value method
* AssetsBundle receive the list files and remains
2016-06-14 09:46:25 +02:00
Jainik Patel eda051f43d [REM] web: Remove GTK icons and replace them by Font-awesome 2016-06-13 12:04:17 +02:00
Christophe Matthieu d0f4b5f608 [FIX] web_editor: display background color to translate 2016-05-26 08:13:33 +02:00
qsm-odoo ea2e0eea78 [FIX] web_editor: snippet colorpicker option
When going over the colorpicker when no bg-* class was selected yet,
the bg-undefined class was added on the snippet.
Also, when clicking on the reset button, the bg-* class was removed
but the selected button in the colorpicker was not unselected.
2016-05-24 17:49:14 +02:00
Christophe Simonis c4bba868f0 [MERGE] forward port of branch saas-9 up to 087729f 2016-05-13 15:58:06 +02:00
Christophe Simonis 7f2a9e77b6 [MERGE] forward port of branch 9.0 up to dcab356 2016-05-13 14:08:51 +02:00
Jeremy Kersten 613ee31f9c [FIX] web_editor: video - allow to add video from unknown source
There are not cat... but you cannot know all the existing website in the world...
So, have faith in the user !

To do: allow to customize size or get it from iframe provided
2016-05-13 12:37:51 +02:00
Nicolas Lempereur 38e35cc442 [FIX] web_editor: scroll and editing menu modal
The class modal-open on body tag allow to scroll on the modal content
which is useful if the content is taller than the window viewport.

When closing the modal, this class is removed but there may be another
modal open on which we will not be able to scroll to view
buttons/content if too big.

This commit check if a modal is still opened after closing an editor
modal and in the affirmative add back the modal-open class.

opw-674475

note : was already present in 8.0 with ec47493, it is also present for
web.Dialog (but the modal of the editor do not inherit from web.Dialog)
2016-05-12 15:56:14 +02:00
qsm-odoo 89c0266b93 [FIX] web_editor: backend colorpicker in editor
The web_editor.colorpicker defines a series of color buttons which
toggle the bg-* and text-* classes. The problem is that themes can
define new buttons whose bg-* and text-* classes only exist in the
frontend. So these buttons should not be displayed in the backend.
Only solution for the current implementation is to add this ugly rule
(in this backend file) which hides every button and redisplayed the
default ones.

This fix is temporary and has to be improved in next versions.
2016-05-02 11:06:09 +02:00
qsm-odoo e3ce70a64d [FIX] web_editor: backend editor style
The editor had been restyled thinking its DOM structure was the same
in every context. The problem is that the message composer editor
DOM structure is different. So, some important style like button
icons were missing in this context.
2016-05-02 11:04:14 +02:00
Christophe Simonis bb8f0f1fc3 [MERGE] forward port of branch saas-9 up to 4d337f7 2016-04-25 14:43:44 +02:00
Christophe Simonis 4d337f72ed [MERGE] forward port of branch 9.0 up to ac7beb3 2016-04-25 13:33:01 +02:00
Adrien Dieudonne 68ba897ce9 [FIX] web_editor: fix svg issue
className should return a string but svg node returns an object
2016-04-25 10:34:18 +02:00
Olivier Dony ee804e1d32 [MERGE] Forward-port 9.0 up to 74d8cbc190 2016-04-21 18:05:14 +02:00
Raphael Collet 9fba75bd54 [FIX] web_editor: save translation values as HTML or XML fragment
The translation value is given as an HTML fragment.  It is converted to a valid
XML fragment if the translation's field requires it.
2016-04-21 16:14:34 +02:00
qsm-odoo f49739124d [FIX] web_editor, website: snippet handles and add job offer
* Bad forward port of saas-9 created a bug where the snippet handles
were wrongly positioned.
* The add job offer button did not work as the modal was marked to
dismiss itself on click (and because this button has not any handler
attached to it; it's the only real link amongst the add buttons).
2016-04-06 16:36:38 +02:00