Commit Graph
464 Commits
Author SHA1 Message Date
Adrien Dieudonné e6c747b43b [REF] *: keyboard: replace deprecated charCode, keyCode and which properties
These properties are deprecated.

We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code.
Note that we prefer to use the `key` property as multiple physical keys
can send the same value (e.g. Enter can also be sent by the numeric pad).
We should only use `code` when we explicitly want to target a single physical
key on the keyboard.

By doing this, we can now remove the dependency of `jQuery.ui.keyCode`
that was used as mapping of key code descriptions to their numeric values.

References:
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated)
https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated)

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key

https://api.jqueryui.com/1.12/jQuery.ui.keyCode/

Some links that helps:
https://w3c.github.io/uievents/tools/key-event-viewer.html
https://www.toptal.com/developers/keycode/table

closes odoo/odoo#139809

Related: odoo/enterprise#49591
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-26 08:46:00 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
Shaan Thakkar (THSH) 4e7d383692 [FIX] website_slides: unwanted html text
How to reproduce:
=================
1. Open any course having quiz.
2. Select quiz content.
-> In the quiz template we can see that the html content is not sanitize.

Technical:
==========
I think the issue arises after this commit https://github.com/odoo/odoo/commit/0d7acf60b4cca84a8c700edd97af8c4de6b78010

After this commit:
==================
Now t-esc is deprecated and the HTML text is not sanitize in the template
so instead of t-esc we are using t-out.

Task-3555159

closes odoo/odoo#138873

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-25 11:37:30 +00:00
FrancoisGe bb09cf76e3 [REF] *: remove legacy time.js
The purpose of this commit is to delete the legacy/js/core/time.js file.
We have therefore replaced all calls to time.js with the l10N/date.js utilities.

Part of task 3439226

closes odoo/odoo#138609

Related: odoo/enterprise#48918
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-18 08:56:06 +00:00
Michael (mcm) 94824d8767 [IMP] *: remove legacy notification service mapper
This commit removes the mapper to the notification service and adapts
widgets that display notifications.

task 3439226

Part-of: odoo/odoo#138348
2023-10-13 09:17:45 +00:00
Nasreddin Boulif (bon) e22010ad89 [FIX] website_slides: hide suggested slides page slide when click prev
Step to reproduce:

  - Install `Elearning` module
  - Go to any course and a content as document
  - Upload a pdf with more than 1 page
  - Go to the website and click on the course then on the content with
    the document
  - Go to last page and click on next button (should display suggested
    slides page)
  - Click on previous button

Issue:

  Page displayed is not the last one, but the one before.

Cause:

  When clicking on the previous button, the current page is still the
  last page (just with the suggested slides page on top of it as
  overlay), and therefore will decrease it to the page number before
  last page (nb last page - 1).

Solution:

  When clicking on previous button, if we are on the suggested slides
  page (by checking if overlay is not hidden since no attribute is set
  on `EmbeddedViewer` to know if we are on that page), hide it.

opw-3482712

closes odoo/odoo#137644

X-original-commit: 422625615b2f6708667fa44d2a9e83ad3e66e5af
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-10-10 08:19:29 +00:00
Romeo Fragomeli 5f454f0ccb [IMP] web,web_editor,website_slide: sortable service for frontend usage
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.

The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).

```javascript
// start / setup
const sortable = this.call(
    "sortable",
    "create",
    {
        ref: { el: document.querySelector(".list") },
        elements: ".items",
        handle: ".drag-icon",
    },
);

// on attach callback / on mounted
const sortableInstance = sortable.enable();

// on destroy / on willUnmount
sortableInstance.cleanup();
```

Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse

task-3439226

closes odoo/odoo#137527

Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-10 01:59:35 +00:00
Guillaume (gdi) b3a1d0f9d0 [IMP] website, *: use BS mixin to have responsive font sizes
*: auth_totp_portal, event, portal_rating, web, web_tour, website_blog,
   website_event, website_event_booth, website_event_sale,
   website_event_track, website_event_track_quiz, website_payment,
   website_sale, website_sale_comparison, website_slides,
   website_twitter

This commit allows to have responsive font sizes on all the Odoo
frontend. It is based on the Bootstrap mixin `font-size` which
calculates the font size based on the viewport width.

task-1958098

closes odoo/odoo#129469

Related: odoo/design-themes#673
Related: odoo/enterprise#44578
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-08 22:12:13 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Mahamadasif Ansari 3389bbafad [REM] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Ref-https://github.com/odoo/odoo/pull/130467

task-3508331

closes odoo/odoo#136920

Related: odoo/enterprise#48065
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-28 16:57:55 +00:00
Michael (mcm) 7422eb643c [IMP] *: remove legacy rpc
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.

closes odoo/odoo#136271

Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-27 11:33:01 +00:00
Shubham Thanki 6ca91cea77 [FIX] website_slides: update Vimeo description
Before this commit:
- Select a course from the website, and click 'Add Content'.
  From the 'Add Content' window, click 'Video'.
- The description with the title 'On Vimeo' is not up to date with
  Vimeo privacy management.

After this commit:
The description is now up to date.

task-3458724

closes odoo/odoo#136083

X-original-commit: 4a1d2a2726ce83edbf28dd478c60a3e6f67d4470
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-21 07:40:06 +00:00
Samuel Degueldre 4aaee61a5f [REF] website_slides: remove usage of legacy dialog to enroll
The Dialog widget is deprecated and will soon be removed, this commit
converts the usage of this dialog for the enroll buttons to use the new
dialog service.

To avoid duplicating the opening logic in the Quiz code, the selector of
the widget that opens the dialog now targets the #wrapwrap and uses
event delegation for the button, avoiding the need to manually spawn the
dialog for buttons added to the DOM after the first load.

closes odoo/odoo#135476

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-18 10:14:07 +00:00
Aaron Bohy 0d7acf60b4 [REF] *: remove legacy Markup
Use owl.markup instead.

Part of task~3439226

closes odoo/odoo#134793

Related: odoo/enterprise#47124
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-11 19:13:59 +00:00
Aaron Bohy dc680a4429 [REF] web,*: stop using and remove legacy utils
*account,web_editor,website,website_sale,website_slides

This commit removes all legacy utils except Markup, which will be
removed in another PR. A lot of those utils were no longer used and
thus have just been removed. Those that were still used either
already existed in the wowl codebase, so usecases have been adapted
to use the new version instead. A few have been re-implemented (or
moved basically) to the wowl codebase (e.g. isEmail and humanSize).

Part of task~3439226

closes odoo/odoo#134620

Related: odoo/enterprise#47044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 08:29:58 +00:00
Romain Estievenart 507c368836 [IMP] *: remove jquery.ba-bbq 🍖
Task Id: 3439226

closes odoo/odoo#133763

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-01 15:09:51 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Michael (mcm) 629a046e03 [IMP] web,*: empty services/core.js
This commit removes almost all exports of the module services/core.js
(only the bus is left) and adapts the module that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
FrancoisGe e3da5f1b7d [REF] *: convert legacy dialogs
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.

closes odoo/odoo#131278

Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-16 16:05:12 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant 065a2f451a [REF] *: csrf_token is not available in the rendering context
As the templates are now rendered with owl, csrf_token is not available
in the rendering context.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant f956e83c74 [REF] *: remove qweb.render
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:28 +02:00
Jorge Pinna Puissant 7b1d82aa9b [REF] *: add t-key when needed on the template
As all the templates are now imported in the owl app, the templates must
comply to owl.

t-key is mandatory when using a t-foreach

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:27 +02:00
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Fabien Pinckaers 3e5b26e56b [IMP] website_slides: imp layout of left panel, secondary links
closes odoo/odoo#131141

X-original-commit: 9efaf53786c30dd23c09b8a1d898ecf97cb2e88b
Signed-off-by: Fabien Pinckaers (fp) <fp@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-09 03:07:43 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
 web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.

task-3292454

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Lopes Marc (loma) 248ee476fd [FIX] website_slides: create new sections only once
Bug to reproduce
----------------

- Log in as admin
- Go to the frontend page of a course
- Click on 'Add Section'
- Fill the form (name input)
- Press 'Enter' or click on save button x times
x sections with the same name will be created

Specifications
--------------

Prevent the 'Add section' form being submitted multiple times in a row.

task-3432418

closes odoo/odoo#131107

X-original-commit: a91a60b4be5b2f606d20fbe574625b85e43407f6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-08-08 08:56:12 +02:00
amdi-odoo c3157da12f [IMP] website_slides{_survey}: add slide icon class field
Add a slide icon class field to prevent computing
the fa-class icon from the slide type in the template
everytime we need it.
Also, using a template wasn't suitable anymore as we
may need the icon outside of its own <i> tag
(see slide_sidebar_done_button).

Task-3378180

closes odoo/odoo#125859

Related: odoo/upgrade#4802
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-08-07 19:57:21 +02:00
Michael (mcm) 00d8aef1c7 [REF] web, *: remove legacy patch
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.

closes odoo/odoo#130867

Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-07 10:58:48 +02:00
amdi-odoo d4ff6ec75a [FIX] website_slides: fix content toggle done
Purpose
=======
Fix the traceback which was appearing when toggling
as done the content in the course template.

Specification
=============
The traceback happened because when all the content in the
section has been completed, we want to collapse the next section
automatically. However in this view the sections aren't
collapsable which resulted in calling methods on null HTML elements.

Fixing this by checking if HTML elements exists before trying to
collapse the next section.

Task-3449558

closes odoo/odoo#130633

X-original-commit: 51f82b306ed12dc2c8e32d2a0bd3052f8eed5d2a
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-08-03 12:11:53 +02:00
Aurélien Warnon 84038b99b4 [FIX] website_slides[_survey]: allow to share content after certification
When finishing (and succeeding) a certification in the e-learning module, you
can 'share' the content of the course by email.

But the "Send Email" button is unresponsive.

This is caused by having nested `<form>` tags: the one of the share modal is
inside the main survey form element.

To resolve this issue, we turn the `<form>` tag into a `<div>` tag in the
sharing template, as it does not need to be a form since it's never submitted.
Indeed, the sharing request is sent through attaching an event handler on the
"Send Email" button which still works fine after our tag replacement.

Note that this fix requires updating the module, but there is no (easy) way to
fix it otherwise, and we consider it acceptable as the impact is pretty low.

In addition to that, we also need to add a survey form JS override to correctly
attach the "ShareMail" widget when the screen is loaded to the "finished" page.

Indeed, as the survey form loads and replaces its content in AJAX rather than
fully reloading the page, we need to watch for the screen refresh and then
manually attach the widget so that the button handler is functional.

During FW to 16.4, we also fixed a small oversight of:
odoo/odoo@e0257347a7

Where we did not correctly add the "email_sharing" parameter when sharing the
certification content in the success screen.

Task-3360175

closes odoo/odoo#130613

X-original-commit: 337762b864d7b06abd7d1622083c5f00d7c7e7f7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-08-03 12:11:49 +02:00
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Pierre Pulinckx (pipu) 09535ef5e6 [REF] website_*: Change registerTours of tour_utils
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.

This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().

task-3292454

closes odoo/odoo#130248

Related: odoo/design-themes#678
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-02 13:20:23 +02:00
Nasreddin Boulif (bon) cbff652b10 [FIX] website[_slides]: Unhide conditional elements in fullscreen
Steps to reproduce:

  - Install `website_slides` module
  - Create a course and add a slide of type `Article`
  - Go to frontend and edit the slide
  - Add a text element and edit conditional visibility
    (e.g. visible only if user logged in)
  - Save and open the slide in fullscreen mode (with any logged user)

Issue:

  The text block is missing.

Cause:

  The slide is rendered in lazy load after that the code that unhide
  conditional elements is already executed (on event `DOMContentLoaded`)

Solution:

  Extract the concerned code so it can be called and re-executed after
  the slide is rendered also in fullscreen.

opw-3225444

closes odoo/odoo#129646

X-original-commit: 553702c99cbd90edfb509ca9e7ab0c99c73a96e6
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-07-31 16:10:58 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Ipsita Borisagar bb432c2893 [FIX] website_slides: prevent content overflow outside the window
When the user adds the "Title" or "Certificate" in a large number of
characters, the content goes beyond the window.

Technical:
By using this class it applies width 100%, which resolves the issue.

Now, the content stays within the sheet.

Task-3368902

closes odoo/odoo#129014

X-original-commit: 44720aa6e7080ce849af329d8c92681489e093fb
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-07-19 20:45:09 +02:00
Pierre Pulinckx (pipu) 504b4a7178 [REF] *:Replace moment usages with luxon
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.

task-3391739

closes odoo/odoo#127406

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-13 14:47:41 +02:00
Maruan Aguerdouh (magm) 2adcb5a989 [FIX] website_slides: quiz success modal displayed properly
After refactoring the modal options to stop using the `Underscore.js`
library, the modal was not displayed properly anymore. You can check the
behavior by completing a quiz in the website_slides module.

If we set the `option` as the target of the `Object.assign()` we then
got the optiond properly applied and we got the same behavior as before.

Refactoring commit:
https://github.com/odoo/odoo/commit/f4f0f783183507df8227b37fe1234c256325df6d

opw-3389193

closes odoo/odoo#128132

X-original-commit: 46ed163e39238f7f4d7115711fe9dee93abd4cde
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-07-12 13:58:09 +02:00
Mahdi Cheikh Rouhou (macr) 0ecc280e7e [FIX] website_slides : Adjust container to contain the full course name
When we have a long course name or we update the font size to something
big (24 px) for example the course name and the progress bar will overflow
outside its container.

Steps to reproduce the error :
1- go to one of the courses and update it's name to make it a bit long
2- click on one of it's content and got website preview
3- you can see that the progress bar is outside the container
4- if not : click edit -> theme -> change font size to 24 px
5- You can see now clearly that there is overflow from the container

The origin of the problem was because the container has fixed height
equals 80px

opw-3191888

closes odoo/odoo#126460

X-original-commit: 8184374450f8e2b775a29ff05b3128c24579bbba
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-06-27 16:26:59 +02:00
amdi-odoo 71823f54f5 [FIX] website_slides: fix sidebar overlay
In the course fullscreen view, a black overlay is
hovering the content on medium screen size and lower
when the sidebar is active.

Fix the black overlay which is still showing after
closing the sidebar. When the sidebar is close the
overlay shouldn't be displayed.

As the content is translated to the right and still
fully visible on medium screen size, a black overlay
isn't needed. Only show the black overlay for small
screen size and lower.

Task-3371743

closes odoo/odoo#126118

X-original-commit: f8c45330605837c61f20bed962532b339afc4460
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-06-23 08:10:51 +02:00
amdi-odoo b3d579e7cc [IMP] website_slides: save space in left content panel
Purpose
=======
Earn some space in the left content panel (fullscreen and
course page panels).

Specifications
==============
- Align additional resources to the left and remove bold
on the links and icons.
- Remove "mark as done" bubble and push content to the left.
- Question mark, youtube, etc.. icons now become the mark
as undone button. Icon should have a border outline and be empty
- "V" icon remains the one we use when done (filled and green
as currently)

Task-3265917

closes odoo/odoo#125646

X-original-commit: 9dabc99c7711501ec84b3ce0902cb78fed43a868
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Dieudonné Amélie (amdi) <amdi@odoo.com>
2023-06-20 13:28:39 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
amdi-odoo 1dc8d10310 [IMP] website_slides: auto-collapse categories
Purpose
=======
Improve the behavior of the collapse/expand categories
in front-end for large courses.

Specifications
==============
In channel content view and channel fullscreen view:
- When following the course, expand the ongoing section and
collapse the other ones.
- When the section is completed, open the next one and
keep the previous one(s) opened.
- If an attendee leaves and comes back, only open the ongoing one.

Task-3284195

closes odoo/odoo#121003

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-16 19:30:41 +02:00
Aurélien Warnon e0257347a7 [IMP] website_slides[_survey]: hide email sharing if not available
This commit improves the various sharing templates to check if there is a
configured mail template before suggesting to share the course/slide by email.

Currently the user gets an error message suggesting to configure templates,
which is not ideal as the sharing feature can be used by everyone including
portal users, that have no idea what that means.

Task-3349606

closes odoo/odoo#123702

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 09:34:56 +02:00
Sébastien Theys 9dba4e0d77 [REF] mail, *: reorganize JS files
Remove "fake" feature sub-folders that make files harder to find.

Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.

Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).

```
- core
    - common
    - public
    - web
- feature
    - common
    - public
    - web
```

The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
  file with a single search.
- Reorganize imports to group them by module, and to sort them
  alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
  And double asterisk should be used for JSDoc comments, not for custom
  instructions.

Part of task-3265211

closes odoo/odoo#124168

Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-08 21:52:44 +02:00
Jérémy Hennecart (jeh) da38afff6d [FIX] website(_slides): delete autoplay of all iframes in the iframefallback
Delete the autoplay for all iframes in the iframefallback.
The autoplay was causing issue where the sound of the previous video
was played on the background. Now we delete the autoplay for all iframe
directly.
This happened in media_iframe_video, youtube player and vimeo videos.
We can do this for all iframe source url directly as it impacts other
modules like website_slides or website_event_track_live.

task-3012952

closes odoo/odoo#122392

X-original-commit: 6be8af36726d750065972e122e8f4a0aa0f56a17
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Hennecart Jérémy (jeh) <jeh@odoo.com>
2023-05-25 16:29:44 +02:00
Abdelouahab (abla) c89b2ddab3 [FIX] website_slides: avoid completing slide when not being a member
To reproduce
============
- add video to a course
- remove user from course if user is enrolled
- open video in full screen mode and play it
- move nearly to the last part of the video so that is detected as completed
- an error will occure

Problem
=======
- when the video is detected to be completed we want to mark the slide as completed
- as the user is not a member, we can't retreive the current slide which is the source
of this issue

Solution
========
as the use is not a member, marking the slide as **Completed** dosen't make any sense,
so checking if the user is member, should solve the problem.

opw-3295662

closes odoo/odoo#122393

X-original-commit: 885d8a18d06d3d3181a345a3fda2a420824f9896
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-25 13:49:52 +02:00
Nasreddin Boulif (bon) b72be1fc95 [FIX] website[_slides]: don't autoplay videos in fallback iframe
Steps to reproduce:

  - Log in as admin
  - Install `eLearning` module
  - Create a course and add a youtube video as a lesson
  - Publish the course
  - Go to the website and click on the course
  - Enable `Editor` mode (top left corner)
  - Click on lesson to open it in fullscreen
  - Click `Back to course` button

Issue:

  Video is playing in the background.
  Same issue occure with video snippet in the website editor (by default
  video is mute but still playing in the background).

Cause:

  When editor mode is enabled, there is a fallback iframe that clone the
  content of the current page that we leave into it.

  Since the youtube video has `autoplay=1` in the URL, it will
  automatically start in the fallback iframe.

Solution:

  For regular website pages, remove the `autoplay` param from all
  media video iframes urls (targeting all `div.iframe` that have a class
  `media_iframe_video`).

  For eLearning, override the `WebsitePreview._cleanIframeFallback`
  method to remove the `autoplay` param from youtube videos URLs.

opw-3226002

closes odoo/odoo#121475

X-original-commit: ad78585cd514f5ff16647572d34937c18a112529
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-16 14:42:17 +02:00