Commit Graph
169 Commits
Author SHA1 Message Date
Priyanka Kakadiya 7f632f909e [FIX] website_forum : fix karma alert-box position
Currently, if user does not have enough karma to perform specific action on
forum, alert-box with appropriate message is displayed to the user.

There are several issues with these alert-boxes, like :
- Click on same CTA multiple times, creates multiple alerts
- Click on another CTAs keeps previous alerts on the screen, and adds
  further alerts, which sometimes overlaps adjacent CTA and looks ugly.

After this commit :
- Alerts are displayed below their related CTAs
- Only one alert appears at a time on the screen

Fixes : #23071
PR    : #23800
Task# : 1829835

This commit closes #23071
This commit closes #23800
2018-05-08 12:38:13 +02:00
Christophe Simonis c5f680200c [MERGE] forward port branch saas-17 up to d08b4407be 2017-09-12 12:09:11 +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) 825c7c1ed6 [FIX] website_forum: fix display of images in a post
Before this commit, the images were messing up the layout of the post, with text uglily lying on their right
This commit solves the issue at rendering of the post, to ensure that current posts on prods be affected in a reversible manner.
Also, we want this commit to have minimal impact

OPW 769721

closes #19322
2017-09-08 09:44:30 +02:00
qsm-odoo 0fb82ab34e [FIX] web_editor, *: allow editor dialogs in simple HTML areas
* website_forum

Summernote is instantiated as a simple text editor for 'simple' HTML
backend fields and in website_forum. In those cases, the user was not
able to open editor dialogs anymore as their opening was now handled
by the RTE widget in web_editor since the recent website refactoring.
The goal was to use `this._rpc` in these dialogs (and this required the
dialogs to be attached to the widget parenting system).

As a fix, a new component was implemented to handle these dialog
openings and this component is thus created by the RTE widget and the
other places that need the feature. The right fix would be a better
integration of the summernote editor in the parenting system but this
requires a lot more work than this commit, this will be the goal of the
future editor refactoring.
2017-08-23 11:27:55 +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
Christophe Simonis b6c7d71899 [MERGE] forward port branch 10.0 up to cd1a8f6252 2017-06-09 13:28:06 +02:00
Nicolas Martinelli f66fb9061d [FIX] website_forum: karma link
The karma link is an hardcoded page from odoo.com. The information might
therefore not be correct depending on the configuration of the user.

We change to redirect to the FAQ, which also contains Karma information.

opw-746383
2017-06-08 17:01:17 +02:00
Christophe Simonis 80c1d1e355 [FIX] website_forum: wait templates are loaded before binding events
This is required since a4dc9a8032
2017-02-10 16:45:34 +01:00
Christophe Simonis 0b846861b6 [MERGE] forward port branch 10.0 up to 5dc1c57 2016-12-01 17:05:08 +01:00
Jeremy Kersten 4fa39c0e19 [FIX] website_forum: ask reason when refuse a post.
Call was done in ajax to speed up the moderation and don't wait refresh at each accpet/refuse post.
But the problem is that when you refuse a post, you need to be redirected to a new page to ask more
infos about the reason.
The fix is to do the request in ajax only when it is an 'accepted' post.

This commits fixes odoo/odoo@14462
2016-11-25 09:13:33 +01:00
Dhaval Panchal c8d0fd4a50 [IMP] website_forum: Change profile picture for forum users. 2016-11-02 11:11:27 +01:00
qsm-odoo fb363b572b [FIX] *: adapt odoo interface violet
Change color #a24689 to #875A7B

Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).

Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
2016-10-05 10:29:00 +02:00
Jeremy Kersten 5c11310070 [FIX] website_forum: make moderation queue async
Don't refresh page between each validation.
2016-09-28 17:26:13 +02:00
Jeremy Kersten df2a28c86f [FIX] website_forum: valid url at submit.
Older regexp was not working, event with the sample: https://www.odoo.com
Should be shared in util.js
2016-09-21 21:29:18 +02:00
Christophe Matthieu d39fbea9ad [IMP] website_forum: convert tours to use web_tour.tour 2016-08-30 13:54:28 +02:00
qsm-odoo f9a84b5ebc [IMP] web_tour, *: allow to properly extend tours
* crm, project, website, website_event, website_blog, website_forum,
website_sale

Eg: the tour 'shop_buy_product' is extended by the website_sale_options
addons to add a step to close a modal.

The current solution was requiring the module that defines the tour
to extend, then add/remove steps in the "step" key of the tour
definition.
Some of the problems with this method were:
* The "register" method calls the "update" method to immediately
search for tip to place once registered (as register may be called
after the DOM is ready). So extensions of tours were happening after
the tours were started (and the tours were not restarted).
* The addition/removal of steps was happening after they were filtered
according to the "edition" key.

To allow extension, the system is changed as follow:
* The "register" method now only saves the steps and options without
modifying them and does not call the "update" method.
* Once the DOM was ready, the tour service started listening to DOM
mutations and called the "update" tour method. Now, this "update" call
is replaced by a "_register_all" call, on DOM ready and at the end of
the current call stack (which makes sure all modules are loaded). This
"_register_all" method marks the registered tours as ready after having
filtered the steps according to the "edition" key and initialized the
current step to trigger.
* Also, tours can now define a "wait_for" option which allow them to
be marked as ready for run and update after the given deferred. Those
tours can now also be extended without having to wait for the deferred.
PhamtomJS must wait for the "ready" key to be true to run the tour.
2016-08-26 13:39:55 +02:00
Christophe Simonis 523d3af131 [MERGE] forward port branch saas-12 up to 16d65a8 2016-07-29 17:55:21 +02:00
Jeremy Kersten 7b0a44737f [FIX] website_forum: show to the end user that he should be logged in
Show to the end user that he should be logged in to use action where karma
is required.

Before this commit, a user not logged in see that x karma is required to
perfom the action.

After this commit, a user not logged in who click on an action which require
 karma will get a message "Sorry you must be logged in to perform this action"

This commit closes #12731
2016-07-28 22:15:16 +02:00
qsm-odoo eaf8e82efb [IMP] *: activate automatic tour tests
* project, crm, point_of_sale, website, website_sale, website_blog,
website_event, website_forum
2016-07-18 14:22:29 +02:00
qsm-odoo 3247400291 [IMP] website(_*): tours
* Adapt modals for new pages/product/... to leave some space for tour
tips on the right
* Remove the "click on add page" step which was the start of each tours
and leave it to be the last of the website tour
* Change position of some tips
* Remove step "click on parent button" in website tour as it is not
necessary anymore
* Remove the possibility to skip the frontend tours
2016-07-05 18:05:24 +02:00
qsm-odoo cd16749564 [IMP] website(_*): adaptation of tours to new system
+ Adapt website welcome message

(Note: temporary duplicate tour: use old version for tests and new
version for onboarding)
2016-07-04 17:24:00 +02:00
Fabrice Henrion 6a96c838f8 [IMP] website_forum: wording
Closes #12124
2016-05-27 11:33:27 +02:00
Christophe Simonis 7046c2fbe6 [MERGE] forward port of branch saas-11 up to e4500d0 2016-05-26 16:58:37 +02:00
Christophe Simonis 44fd6a55f3 [MERGE] forward port of branch saas-9 up to 413ba94 2016-05-26 14:10:55 +02:00
Christophe Simonis 413ba9445c [MERGE] forward port of branch 9.0 up to 24eebbd 2016-05-26 14:06:36 +02:00
Jeremy Kersten bfb2263565 [FIX] website_forum: typo in translation 2016-05-25 14:39:38 +02:00
Christophe Simonis 4f6d3b680a [MERGE] forward port of branch saas-11 up to bb442fd 2016-05-24 14:48:59 +02:00
Martin Geubelle 640ac29f11 [FIX] website_forum: correct URL for comment deletion
When searching for the action of the form related to the button, the form is not necessarly the direct
parent of the button but could be upper in the architecture.
2016-05-19 11:16:25 +02:00
Foram Shah 3b40244ae8 updated the description of 'website_forum' 2016-05-10 15:24:49 +02:00
Fabien Pinckaers 4c8e908b49 [IMP] Speed up app switcher loading: 645k --> 137k lossless compression for all icons 2016-02-26 11:39:38 +01:00
qsm-odoo ed46965dbe [FIX] web*: tours
Selector changes + No need to open the snippet panel anymore.
2016-02-24 13:47:36 +01:00
Christophe Simonis 5f860a4433 [MERGE] forward port of branch saas-7 up to 31ce19b 2016-01-05 17:05:17 +01:00
Martin Trigaux 34348ebf8d [FIX] typo, English 2015-12-22 11:58:47 +01:00
jas 284d82623f [IMP] website_forum : tag update
It is now possible to follow tags in the forum app. When following tags you
will be notified for every new post linking this tag.

A small karma update is also performed. We now correctly use karma to retag
posts, and karma to create new tags.
2015-11-26 15:16:00 +01:00
Martin Trigaux a2f6e77b08 [FIX] English
Typos, unclear, rephrase, harmonise terms.
Thanks Transifex reporters!
2015-11-17 16:54:18 +01:00
Julien Louette 205ce98656 [IMP] website_forum: moderation & anti spam 2015-09-05 14:44:06 +02:00
Christophe Simonis edeceba7df [MERGE] forward port of branch saas-6 up to 7a768a4
Due to `sale` rewrite (94716a3f14),
the commit 503820acb6 has been partially
ignored (in sale.order.line) and will be rewritten later using new-api.
2015-08-28 15:07:16 +02:00
Christophe Matthieu a1194b2bb8 [FIX] website: use and improve ctrl-z/v in forum
* fix erroneous paste edge case,
* improve selection and pasting
* delete and backspace with hr

opw-646222
2015-08-27 18:09:39 +02:00
Dharmraj Jhala bc50f53d65 [IMP] website_forum: extended biography
The biography of established users (with high karma) can be seen
with an expanded tooltip. This gives to users that participate
some kind of reward and gratitude of their work.
2015-08-11 16:12:33 +02:00
qsm-odoo 5960d3cff8 [IMP] *: New icons 2015-08-11 14:31:10 +02:00
Christophe Matthieu 71732dceb6 [IMP] web: module can be asynchronous loaded if it return a deferred
Each module can return a deferred. In that case, the module is marked as loaded
only when the deferred is resolved, and its value is equal to the resolved value.
The module can be rejected (unloaded). This will be logged in the console as info.

Remove if_dom_contains from the website, the modules return a rejected deferred if
the DOM doesn't contains the seleted values.
2015-07-22 12:15:24 +02:00
Christophe Matthieu 9665882fba [IMP] web_editor: adapt css, js and xml to use web_editor 2015-07-10 17:00:12 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
David Monjoie 1f02a25bad [FIX] website_slides: wrapped upload js code into if_dom_contains
To avoid loading unnecessary templates on every page.
2015-05-18 16:47:33 +02:00
Nicolas Lempereur ef34e5827e [FIX] website_forum: css in case of empty title
If the title of a thread was empty, some floating used in the post list
caused an appearance issue.

opw-634687
2015-05-11 15:20:48 +02:00
sha-odoo 252c50f110 [FIX] website*: correct placement of various tooltips 2015-04-21 11:23:50 +02:00
Christophe Simonis a9471c43b9 [MERGE] forward port of branch saas-6 up to e941c0f 2015-04-17 15:33:00 +02:00
Jeremy Kersten 36ae07ed15 [FIX] website_forum: don't use span with style for forum
Forum sanitize the content before to be inserted in db.
So all tags style are removed...

Disabling the option styleWithSpan, will let summernote to use <b>, <u>, <i>
to allow the end user to change the style from an answer / question.
2015-03-31 12:19:57 +02:00
Christophe Simonis 2565aa60e0 [MERGE] forward port of branch saas-6 up to c2b4766 2015-03-25 19:14:46 +01:00