Commit Graph
2090 Commits
Author SHA1 Message Date
rde a91a3a5633 [IMP] website: warn user about key change when editing special file name
The idea is to warn user if he created a special file (website.page with
supported extension) and he wants to change the file's name, which will at the
end also change the key).
If this special file has been t-called elsewhere, they t-call wont work anymore
This is why warning user is needed.

Note that this is different than the already existing page_search_dependencies
that is just checking if the URL is present in menus, templates, blog or pages.
This is about checking if the key is present somewhere. (we assume that if the
key is present, it is surely about a t-call.

Technically, the flow is:
1. Get supported extension
2. Get key dependencies
3. Check if user modify name
4. If name changed and it is/was a supported extension (special file) and it
   has dependencies (surely t-call) then warn user these call wont work anymore

--

search_page_dependencies is also improved by returning links to be clickable
(on delete dialog eg) and splitting template/page results.

it also refactor dependencies warning that was creating HTML in javascript into
using XML template
2017-10-12 16:20:42 +02:00
rde a8fc544c5c [TYPO] website: change some texts 2017-10-12 16:20:42 +02:00
qsm-odoo c1156915c1 [FIX] website: load xml dependencies of website.prompt
The deprecated-but-still-used website.prompt requires some static XML
to be loaded to work. In the case of creating a new website page, this
XML was implicitely loaded by the "Content" menu... but when the user
is on a translated page, this menu is not there. Anyway, this static
XML loading should be done by the website.prompt function itself if
necessary.
2017-10-12 13:31:36 +02:00
qsm-odoo b719e43b15 [FIX] website: allow starting website 'animations' on #wrapwrap
Before 11.0, website 'animations' were able to be started on any DOM
element. Since 11.0, this was reduced to any DOM element inside the
main website element (#wrapwrap). This commit allows this element
to be attached a website 'animation' too.
2017-10-10 09:57:11 +02:00
qsm-odoo a3f899c395 [FIX] website(_twitter): properly stop snippet animations
The `stop` method of snippet animations was renamed to `destroy` (as
animations are now extensions of standard `Widget` class).
2017-09-30 14:33:05 +02:00
rde 4bd8e3e2ed [IMP] website: Script injected in DOM: window.onerror empty params
Before this commit, error thrown by scripts injected in DOM won't return a
clean error on window.onerror.
It would open the crash_manager's show_error's dialog that wouldn't display
any informations except "Script Error." and "Traceback:".
This is because of browser's security reason: it will just give you a
'Script error.' as message and nothing else for security issue.

Now, this kind of error will show a clearer message informing that it is
probably originating from a Javascript file served from a different origin.
There is now also the possibility for developers to handle/override the
behavior when this kind of error is catch to prevent the dialog to open for
example.

Might be of use:
https://blog.sentry.io/2016/05/17/what-is-script-error.html
https://stackoverflow.com/a/7778424
https://danlimerick.wordpress.com/2014/01/18/how-to-catch-javascript-errors-with-window-onerror-even-on-chrome-and-firefox/ (Search for Script Error)
2017-09-30 12:21:27 +02:00
rde c837eaca9f [FIX] website: edit menu not showing url & mailto prefix with '/'
Before this commit:
1. you could not edit a menu URL because the input was hidden.
   This was due to radio options being switched (new page is now selected choice)
   when you create a menu.
   But when you edit, there is no choice and the input should be shown.
2. if you set a menu url to an email address, the display link would be prefixed
   by a / and so it would open mysite.com/mailto:XXX instead of just the mailto

Now:
1. Input is now hidden only when you add a new menu, not when editing a menu.
2. mailto link now works as expected: it will open your desktop mail software
2017-09-30 12:21:27 +02:00
Prakash Prajapati 0b6c9c60d4 [FIX] website: remove left & right margins around todo buttons 2017-09-30 12:21:27 +02:00
Kishan Gajjar 90dbe3c6be [FIX] website: add white background to placeholder image 2017-09-30 11:17:22 +02:00
kap-odoo 230e88264a [FIX] website: removed padding in todo buttons of dashboard.
closes #19733
2017-09-28 09:49:44 +02:00
Vandan Shah fed46211ed [IMP] website: change link for google analytics tracking ID
closes #19730
2017-09-28 09:46:41 +02:00
rde a40236d38a [FIX] website: SEO keywords
Seen behavior: SEO keywords not saving

Expecte behavior: SEO should save

Reason: destroy event method from dialog.js is now hidding modal
programmatically. Which at the end call twice the keywords save
method.
The second time there were no keywords passed to that function
which is causing that behavior (saving empty array).
2017-09-25 10:53:28 +02:00
rde acd0b6da14 [IMP] website: pageManagement - improvements according to first feedbacks
- labelling and screen redesign (update labels, hide labels, hide fields, ...)
 - make UI more mobile friendly (icon biggest, color using less variables,...)
 - Page & Redirection menu are for visible only in debug mode
 - Add meta noindex for website.page not shown in sitemap
 - Add mechanism to be able to edit in backend a broken view
	(Needed for - Internal Error 500, css, js file, ...)
 - website pagemanager dedicated to website_publisher only
2017-09-25 10:53:28 +02:00
Kirti Choudhary d797628779 [IMP] website_sale:set background-repeat property of image to no-repeat so it will not repeat. 2017-09-22 11:41:08 +02:00
Xavier Morel f1a85ba70a [FIX] *: fix a bunch of incorrectly documented docstring
Fix a bunch of ill-documented/incomplete/incorrect method docs
Without this, the automatic doc generation does not work.
2017-09-18 11:54:39 +02:00
Christophe Monniez bfa85c84a6 [IMP] website_sale: manage abandoned cart
Purpose: Add button to see the number of
abandoned carts and the ability to send
a recovery email to those customers.

On the abandoned carts menu, you can see
the SO from the website where no reminder
email has been sent.
By selecting them, you can send an email
to the customer to tell him there is still
a cart waiting.
Clicking on the link, he can reuse his old
cart or merge it with his current one.

An abandoned cart is a SO from a website
sales team, and created after a treshold
parametered by a 'delay' settings (number
of hours to be considered as abandoned).
2017-09-15 16:55:17 +02:00
rde 4ecbacaf59 [ADD] website: add new page management
website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.

From now, we don't have a specific /page controller to serve 'page'.

We use a new model website.page which is rendered if none route matches the url
 and that the field 'url' on website.page matches the request.httprequest.path.

The order to serve a path is:
    - Routes defines in controllers (/shop, /blog, ...)
    - ir.attachment with name matching the path
    - website.page with url matching the path
    - website.redirect with url_from matching the path
    - 404

To improve:
    - allow regexp in website.redirect model
    - allow to edit the view_arch from the page.management via redirect backend
      (needed when traceback in the page, or when modifying a js/css/less/...)
2017-09-15 15:29:37 +02:00
Christophe Simonis c5f680200c [MERGE] forward port branch saas-17 up to d08b4407be 2017-09-12 12:09:11 +02:00
Christophe Simonis bd08d4f052 [MERGE] forward port branch saas-16 up to 3ac2a1106c 2017-09-11 14:02:19 +02:00
Christophe Simonis 3ac2a1106c [MERGE] forward port branch saas-15 up to ec15765eec 2017-09-11 13:30:03 +02:00
Christophe Simonis ec15765eec [MERGE] forward port branch saas-14 up to 48f88992da 2017-09-11 12:35:49 +02:00
Christophe Simonis 48f88992da [MERGE] forward port branch 10.0 up to 7d7e94c6ef 2017-09-11 11:45:44 +02:00
Lucas Perais (lpe) 45e0cd564a [FIX] web_editor, website_forum: allow to post videos on the forum
The commit 8749410b10 corrected the way the iframe was rendered to display a video in v9.0.
In v10 though, the html sanitizer is a bit more severe and cleans data-src attributes, preventing the iframe to have a src

This commit works around that and allows the src of the video to be saved in db

OPW 761424

closes #19125
2017-09-06 13:52:03 +02:00
Christophe Matthieu 95c2bd33a2 [IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset size 2017-08-31 16:26:11 +02:00
qsm-odoo c587c154c2 [REF] website: make better framework for animations
Since commit https://github.com/odoo/odoo/commit/0e08e653cd47e6ef00cf041d774ddec4b83431c1:
The animation 'component' feature was introduced and allowed to define
smooth animation (like the parallax one) thanks to particulary named
methods. This feature was dangerous and ugly and does not match our
convention requirements anymore (in particular adapting a regex to camel
cased method names will be subject to lots of error). Also, during the
website refactoring introduced with https://github.com/odoo/odoo/commit/2972976962617d4b8a0113bae58c640ab41cdff8,
errors were found that were due to this feature. Indeed, it happened
that some existing method names were matched by the regex (as a simple
'on_click'). This feature was also 'slowing' (by a very slow amount)
the page loadings for no good reasons.

The animation 'component' feature has been renamed to 'effect' and
instead of naming methods with particular names, all the effects'
options can now be simply described in the special 'effects' key of
snippet animations.
2017-08-22 13:03:16 +02:00
qsm-odoo f997c128c7 [REF] web, website: share modal.less file
Following https://github.com/odoo/odoo/commit/5658e337c3e0385d3d116e34404ef4086b3e94f0:
The modal.less file is now in the common assets so that the
dialogs' style is shared instead of duplicated.
2017-08-22 13:02:12 +02:00
qsm-odoo 2972976962 [REF] web_editor, website, *: complete refactoring
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour,
  website_blog, website_crm_partner_assign, website_event,
  website_event_questions, website_form, website_forum, website_gengo,
  website_hr_recruitment, website_links, website_mail,
  website_mail_channel, website_mass_mailing, website_quote,
  website_sale, website_sale_options, website_slides, website_twitter

This commit reviews the whole "JS side" of the web_editor and website
apps. This is a first step to be able to improve them with new and
better functionnalities; this commit is not supposed to change any
visual behavior.

The main goal was to achieve a structure similar to the backend one.
Now, the frontend side also has a root widget (like the WebClient)
and all other widgets are attached to it one way or another. This allows
the benefits of using the 'trigger_up' functionnality for example.

As RPC are now mainly done with the `this._rpc` functionnality (being
possible thanks to the parent hierarchy), the frontend will also be
possible to test thanks to QUnit in a future update (besides the "text"
editor side which still requires a refactoring to be able to do that).

---

Here are some of the changes:

(-) conventions and documentation

The code has been updated to follow JS conventions and a lot of code has
been commented (around +2000 lines of comment). This also means that
lots of functions have been renamed to use camelCase or simply to make
their name understandable.
See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines.

(-) deprecated: web_editor.base

The "web_editor.base" module has been split and does not force the
modules which require it to wait for DOM ready anymore. This was indeed
slowing loading times, but also prevented to use some modules in some
contexts (see the LESS editor use in web_studio which is the subject of
another task).
Now the "editor context" can be got thanks to the "web_editor.context"
JS module with its "get" function.
The "web_editor.base" module should probably not be used anymore (see
its code and recent updates).

(-) new: web.dom_ready

If a JS module should wait for the DOM to be ready to be executed, a
new JS module has been created: "web.dom_ready". This should always
be used in a module which only want to instantiate stuff. Do not
extend (or worst, include) classes after DOM ready.

(-) website.website

The "website.website" module has been split. "website.website" does not
return anything useful anymore, it just initialize some miscellaneous
stuff, without waiting for the DOM to be ready. You might want to check
"website.utils", "website.content.compatibility" or `WebsiteRoot`. Also
`website.form` has been deleted (use `this._rpc`), so has been
`website.error`. `website.prompt` will be removed in a future update to
be replaced by `Dialog.prompt`.

(-) widgets are great

Many classes which were not widgets are now widgets. This allows them to
use the 'events', the 'xmlDependencies' and the 'this._rpc' features for
example. Here are some of the main ones:

- Snippet options: these were classes with a `$el` for the menu element
    and `$target` for the customized element. This is still the case
    but following standard `Widget` structure (one exception: using
    `this.$(...)` searches in the `$target` as before this update).

- Snippet animations: instead of class instances with a `$target`
    element which can be `start` and `stop`, these are now standard
    widgets which can be `start` and `destroy`. `this.$target` is
    an alias to `this.$el` for ease of compatibility.

- Snippet editors: instead of class instances in charge of an editor
    overlay, these are now widgets. Each "child" snippet editor is
    properly attached as a "child", which allows editors to communicate
    and to be properly destroyed.

(-) root widgets and website navbar

The frontend is different of the backend. In the backend, the page has
an empty <body/> element and all the components are instantiated from
parent to children (i.e. the `WebClient` is instantiated and is in
charge of instantiating the `ControlPanel`, etc). The frontend cannot
work like that on page loadings as they are way more frequent than in
the backend and we do not want them to flicker. A frontend page is
loaded as a <body/> element which already contains the website navbar
and its menus and the whole content page. JS code has to be "attached"
to these existing elements. This is possible thanks to the `RootWidget`
instances and the specialized `WebsiteRoot`, `IframeRoot` and
`WebsiteNavbar` (see code for details).

(-) lazy loading

No more (or at least a lot less) XML/JS has to be loaded on page
loading, thanks to the use of the `Widget.xmlDependencies` feature.
XML which have to be lazy loaded is loaded only on related Widget
instantiation if necessary, which allows to execute a lot of JS code
before the DOM is ready and to start many widgets on DOM ready (not
later). A visual benefit of this is clicking on the 'edit' button as
soon as it is possible: before this commit, this was sometimes not
doing anything as event handlers were not binded yet.

Still a possible exception: loading the session and locales. This may
be asynchronous stuff which is still required before widget
instantiations but this will be the subject of another task.

(-) deprecated code and code location

More than reviewing code and organizing it, many apparent dead code was
removed. More importantly, mislocated code was put in the right app.
This is the case for snippet animations which is a concept for website
apps but was defined in the web_editor app, or some translation concepts
which were part of website but should have been part of web_editor.

---

There are probably more things to say about this commit but I will let
the comments speak for those.
2017-08-16 11:04:14 +02:00
qsm-odoo 4f925af06f [MOV] web_editor, website: reorganize files 2017-08-16 10:59:39 +02:00
Christophe Simonis 1fa8680286 [MERGE] forward port branch saas-17 up to 48b2ce60ed 2017-08-10 18:07:47 +02:00
Dhawal Limbuwala 39ae811417 [REF] website: improve snippet names and thumbnails 2017-08-10 17:11:09 +02:00
Christophe Simonis 48b2ce60ed [MERGE] forward port branch saas-16 up to 85571bb78c 2017-08-10 17:01:05 +02:00
Christophe Simonis 85571bb78c [MERGE] forward port branch saas-15 up to dde62073ba 2017-08-10 16:22:36 +02:00
Christophe Simonis c3d710d2f6 [MERGE] forward port branch saas-14 up to 80ac087d6e 2017-08-09 17:11:10 +02:00
Kinjal Mehta 26786dba68 [IMP] website_sale: pimp the CSS of the dashboard
The "Best sellers" sections was displayed with hard-to-read colors
2017-08-09 16:11:40 +02:00
Christophe Simonis 80ac087d6e [MERGE] forward port branch 10.0 up to f69655829a 2017-08-09 15:53:37 +02:00
Christophe Simonis f69655829a [MERGE] forward port branch saas-11 up to acbcfa3703 2017-08-09 14:43:39 +02:00
Thibault Delavallée 77d9179f7b [MOV] website, http_routing: move translation support in http_routing
Code managing language in URLs and redirection is moved from website
to http_routing. Override of _dispatch in website now consists in adding
website to the request.

url_for and is_multilang_url tools methods are also moved from website
to http_routing.ir_http as those are required for the moved code.

Some renaming is performed on request attributes previously added in
website. Indeed as website keyword may be misleading now a renaming
has been performed to better understand them :

 * request.website_enabled -> request.is_frontend
 * request.website_multilang -> request.is_frontend_multilang
 * request.httprequest.cookies.get('website_lang') -> ('frontend_lang')
 * first_pass variable in _dispatch is replaced by a new attribute of
   request, routing_iteration, that is the number of routing iterations
   currently done
2017-08-08 14:40:08 +02:00
Thibault Delavallée da8d418ff0 [ADD] portal: add module for customer portal and sharing features
This module adds required base code for a fully integrated customer
portal. It contains the base controller class and base templates.
Business addons will add their specific templates and controllers
to extend the customer portal.

This module contains most code coming from odoo v10 website_portal.
Purpose of this module is to allow the display of a customer portal
without having a dependency towards website edition and customization
capabilities.

Some CSS files used in frontend assets are already moved to have a
working portal skeleton. A is_public method on users is also added
as it will be used in various portal code soon.
2017-08-08 14:23:58 +02:00
Christophe Simonis a6917c22b3 [MERGE] forward port branch 9.0 up to af7eb04fc7 2017-08-07 17:56:45 +02:00
qsm-odoo 5658e337c3 [REF] web, website: o_website_modal -> o_technical_modal
Opening a modal in Odoo should be done thanks to the 'Dialog' class. In
the frontend, there can also be modals which are meant to be shown to
the unconnected frontend visitors and those should then get the style of
the website (bootstrap) and not the one of odoo. To manage this, the
website JS code was extending the Dialog class so that it adds the
'o_website_modal' class on modals which are opened thanks to the class.
The LESS code was then in charge of forcing the Odoo style on those.

This behavior is not the right one. "Visitors" modals should also be
able to be opened with the Dialog class. This commit is a first step
towards to the right behavior:
- The standard 'Dialog' adds the 'o_technical_modal' class on its root
  element by default and allows to not put it thanks to 'technical'
  options.
- 'o_website_modal' is then replaced by 'o_technical_modal'.

What should be done next is:
- Use the Dialog class when it is possible
- Move modal.less in the common assets and make it style only technical
  modals -> remove some forcing of the style on 'o_technical_modal' in
  the frontend

This behavior also allows future improvements, like building a
completely different structure for technical modals which would allow
better designing and the end of visitor/technical bootstrap conflicts
(and so LESS efficiency).
2017-08-03 10:50:55 +02:00
Lucas Perais (lpe) ac3bfee8f3 [FIX] website: fix html editor view to be edited
Before this commit, the view selected to be edited by the html editor was the wrong one
This was caused by the simplification brought about by commit a2ae219d4e
which transfered from python to js the decision to make a view a header for the [customize] menu (on the website
In this case, the first view in the return list of python was the header, and the second the actual view

Now that python just sends a list of unique views without any distinction whatsoever, the right view to pick when entering the html editor is the first one, at index 0

opw 760279

Closes #18603
2017-08-03 09:36:01 +02:00
Lucas Perais (lpe) 8749410b10 [FIX] website: correctly renders iframe for videos
Before this commit, the iframe tags were sanitized as the should, but never spawn back from JS.
Now, the iframe is actually created

opw 750830

Closes #18643
2017-08-03 09:29:14 +02:00
qsm-odoo 16f0e50318 [REF] web, web_editor, website: always let session load translations
Before this commit, the session object was responsible for loading the
translations in the backend only. There was then ugly code in web_editor
(which is also loaded in backend...) which was doing "if frontend then
load translations by myself". This code was also translating templates
while this is the qweb object's job. Now session is always responsible
for loading translation.

Note: the session object should be refactored/split.
2017-07-27 14:31:42 +02:00
qsm-odoo 67e2372d61 [IMP] web_tour, *: allow to extend timeout limit for specific steps
* website

Unfortunately, we cannot guarantee that the duration between two odoo
actions is always less than 10 seconds. Indeed, loading translations
is for example quite slow. With this commit, we are now able to modify
the timeout duration for a specific step.
2017-07-24 17:55:00 +02:00
qsm-odoo 5f1ef0910b [IMP] web, *: lazy load dialog xml template
* web_editor, web_planner, website

The 'Dialog' class is used in both backend and frontend. Also, lots of
actions can be done without the use of any modal. It thus makes sense
to lazy load its related xml only when a first modal is opened.

This change also allows to get rid of the "base_common.xml" file as the
dialog template is the only remaining one in there and, in the future
website update, it will allow to not load any static XML file on website
page loadings.
2017-07-24 14:28:35 +02:00
Christophe Simonis db2f82d5f1 [MERGE] forward port branch saas-16 up to 4ca3d9cadf 2017-07-14 15:51:59 +02:00
Christophe Simonis 4ca3d9cadf [MERGE] forward port branch saas-15 up to aa19cb61f4 2017-07-14 14:27:38 +02:00
Christophe Simonis aa19cb61f4 [MERGE] forward port branch saas-14 up to f1a5e8214e 2017-07-14 13:54:01 +02:00
Goffin Simon 2d54dec940 [FIX] website: Impossibe to open website admin with some languages
When clicking on the app website admin with the arabic language,
it raised an error because this.date_from.format('YYYY-MM-DD') in
function fetch_data returned an arabic date "٢٠١٧-٠٧-٠٥".

opw:751960
2017-07-12 16:12:43 +02:00
stefanorigano 330e0cccd4 [IMP] web_editor, website: preserve tabs in modals 2017-07-10 13:37:40 +02:00