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
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).
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.
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.
* 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).
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.
The `check_access_rule` call allow to remove the `editable` key from the
rendering context (which will lead to the display of the editor bar) if
an access rule prevents the edition of the ir.ui.view record. Also remove
it in case the user has no write access on the model (i.e. demo user).
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.
* 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)
* ...
* 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
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.
* 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
* ...
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.
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.