Commit Graph
367 Commits
Author SHA1 Message Date
Aurélien Warnon 22d1743e26 [REF] website_slides: rename 'webpage' to 'article'
This commit simply renames the 'webpage' slide_category into 'article'.

Indeed, 'webpage' was confusing because it was leading you to believe that you
would have to link external content from another website.

While this slide_category instead lets you build an 'article' with content by
using our website builder.

The changes here are just renaming the slide_category and the labels, there
should not be any functional change.

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:49 +00:00
Aurélien Warnon ffa504887d [IMP] website_slides: slightly improve various e-learning views
PURPOSE

This commit adds some small UI improvements to the e-learning views.
All those small changes are meant to improve the general user experience when
adding content to a course.

DETAILED SPECS

- Change some placeholders / labels
- Inform the end-user that he can edit his 'webpage' slide using the editor
- Inform the end-user that he can add questions to his 'quiz' slide using the
  'Quiz' tab in the backend form view
- Do not update from slide metadata if field value is already set
- Do not allow previews for certifications
- "Allow Download" of slide content is now False by default
  As it was nice to have for "Documentation" courses but does not really make
  sense for "Training" ones.
- Having a duplicate video id is now informative on the frontend and not
  blocking as before (it was allowed in the backend form anyway).
- Show the video title in the frontend preview

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon 0ece0b3263 [IMP] website_slides: add Vimeo integration
This commit adds support for the Vimeo provider in the e-learning platform.

This includes managing Vimeo video links and showing the Vimeo embedded player
in the fullscreen and non-fullscreen viewers.

But also managing video events to:
- automatically set the slide as completed when the video reaches the last 30
  seconds
- go to the next slide when the video ends (if there is one)

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon 7b5427f6d6 [REF] website_slides: refactor external content management in slide.slide
PURPOSE

Globally refactor the way we handle external content (YouTube videos,
Google Drive documents, ...) in the course slides.

This includes both technical changes (new computed fields, rename, ...) as well
as visual changes on the form views that allow introducing new content, both in
the backend (slide.slide form view) and in the frontend (course main website
page).

SPECS

TECHNICAL REFACTOR

1. Rework the "url" field

This field was used without any distinction for videos, regular documents and
images, leading to a big confusion both technically and visually.

The urls are now split in separate fields (video_url, document_google_url and
image_google_url), based on the type of slide.
Those fields are implemented as 'related' to the stored 'url' field to avoid
extra storage.

This change globally increases the readability and usability in the code, and
also allows for clear labels on the various views.

1b. Rework the "binary_content" field

The same way as for the 'url' field, the 'binary_content' field has been split
into 2 related fields ('document_binary_content' and 'image_binary_content').

This allows for more readability and also helps in the form view to limit the
file selection to the supported file types.

2. Remove the "document_id" stored field

This field did not have to be stored since it can "easily" be inferred from the
video/document URL with some regex work.

3. Remove the "mime_type" field

This field's value was only determined by an external call to the Google Drive
API. It was inconsistent because not set for manually uploaded document and was
used for some strange checks that seemed to work but did not make much sense.
(e.g: used to make the difference between a Google Drive video and a YouTube
video??).

It has been replaced by a "document_type" field, which is always 'pdf' for
local files (only type we support) and inferred from the mimeType returned by
Google Drive metadata for external documents.

This allows, for instance, to show pretty icons next to every slide based on
their type, "sheet" files (Excel, Google Sheet, ...) share the same icons, the
same principle is applied to "doc" files (Word, OpenOffice, Google Doc, ...)
and finally "slides" files (PowerPoint, Google Slides, ...).

4. Introduce several computed fields

Such as:
- video_source_type
- youtube_id
- google_drive_id

These fields are mostly inferred from the slide type and the related URL.
They are used to make clear checks in the code and ease readability, for
example when constructing the slide "embed code" to insert it in the frontend
full screen viewer.

5. Remove the "presentation" slide_type

The slide type "presentation" was some kind of very confusing type between
image and pdf. It was mostly relying on the fact that the content had a bigger
width than height ('landscape' display).

This lead to a lot of confusion both in the code base and in the various forms
allowing to introduce new content ("what should I choose? document or
presentation?").

In order to simplify everything, we completely removed the slide type
"presentation" and converted all the data that had this type and the various
code checks to the type "document" instead.

Meaning that we end up with the following slide types:
- Infographic - for images, local files + external links
- Web Page - local input only
- Document local files + external links
- Video - external only, YouTube or Google Drive links
- Quiz

FUNCTIONAL

Following the technical changes here above, we can improve the form view of the
slide.slide model as well as the website form that allows adding new content.

1. Slide form view

To make it clear where the source of the document comes from, we introduced a
"source_type" field that is either "local_file", used when uploading a file
from your computer, or "external", used when linking content from Google Drive.

The source_type selection appears when adding content of type "document" or
"infographic" and conditions the display of the file upload button or the
document_url field.

2. Adding content from the website

When adding content from the website, the user is now invited to select from
ALL the available slide type, meaning we added "Infographic" to the selection.

Before this change, if you wanted to link an image, you had to select the type
"presentation" (that has a PDF file as icon...) and then input an image file.
The JS then processed the file type to determine the slide type.

As this was slightly confusing for the end user, we decided to use the same
approach as the form view, meaning you FIRST select the type of slide you want
and THEN input the content as a local file or external link.

Since we now handle all types of documents when using an external Google Drive
link, the various screen and text helpers have been reworked accordingly.

3. Handle more types of slides with the new "slide_type" field

This commit also introduces a new "slide_type" field.
(Don't get confused, the previous "slide_type" field has been renamed to
"slide_category" in an earlier rename commit).

This slide_type is a refined slide_category:
- Videos are split into 'youtube_video' and 'google_drive_video'
- Documents are refined based on the file mime_type if it's external content
  For example, if you link a Excel file, the slide_type will be 'sheet'.
  If you link a Google Doc, the slide_type will be 'doc'
  etc...
  (Local documents are only PDFs since it's the only type we support for now)

This small change allows to include minor nice details into views, such as a
refined icon for each slide_type on the website.

LINKS

Task-2510174
UPG PR odoo/upgrade#2498

Part-of: odoo/odoo#71477
2021-11-30 15:21:48 +00:00
Aurélien Warnon ab0b36e8a5 [REF] website_slides: rename slide.slide fields
This commit simply applies the following renames in the slide.slide model:

- 'datas' is renamed into 'binary_content'
- 'slide_type' is renamed into 'slide_category'

This changes intend to ease the next bug refactoring of the website_slide
module content management.

There should be no functional changes applied in this commit.

Task-2510174

Part-of: odoo/odoo#71477
2021-11-30 15:21:47 +00:00
Aurélien Warnon 043b3385d2 [IMP] website_slides: improve slide.embed feature
Currently, the slide.embed statistics only work if a 'Referer' header is passed
in the request object.

The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).

This commit refactors the slide.embed feature to work even without a referer
header.
When the header is missing, the incremented count will be stored under a
common slide.embed record with a url field = False.

This count is still useful because the end-user will want to know if the slide
is popular externally, even if we don't know on which website it has been
embedded exactly.

In addition, we add more visibility to the slide.embed feature by introducing
a stat-button on the slide.slide form view, that redirects to the list of
slide.embeds for this slide.

Finally, we also renamed the 'embedcount_ids' field to 'embed_ids' to get a
better / clearer naming.

A few tests about embed detection were added to ensure this behavior.
(Tests are based on the work of Nathan Marotte <nama@odoo.com>).

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
Aurélien Warnon 6638b79c5e [IMP] website_slides: improve sharing control when slide is embedded
This commit improves the sharing control when the slide is externally embedded,
meaning embedded outside of the Odoo website, on a third party.

Previously, there were several buttons to share (by email / social / embed),
but the end result was really strange with some kind of overlay content
displayed on top of the PDF viewer that was almost unreadable.

Now, we simply re-use the "slide_share_modal" template to get a consistent
sharing feature whether it's embedded externally or not.

Side note: this removes the ability to share by email, which was not working
anyway since it requires the user to be logged-in to the system, which will
most likely never happen if said user is actually viewing the slide on a third
party website.

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
Aurélien Warnon 1ab9455a9a [IMP] website_slides: refactor slide.slide embed detection
This commit slightly changes the embed detection for slides.

Currently, we use the same URL to embed slide content within the e-learning
module and when the end-user wants to embed that content on an external
website.

However, we want to know whether the slide is embedded externally or not to
show different controls and update some statistics.
The code previously relied on the presence of the "referer" header to achieve
that detection, if the referer URL comes from a domain that is not this Odoo
website -> then it's embedded externally.

The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).

Instead, we change this to let users embed on external websites with a
*different* URL.

When the embed comes from '/embed_external/', we now easily know that it comes
from an external embed and don't have to do some further and potentially tricky
processing.

We introduced a computed 'embed_code_external' field that is computed the same
way as the embed_code except for that small route distinction.

This also easily solves any issue that could come with multi-website /
different root URLs etc.

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
ijas ahammed 4566e1b23d [IMP] website_slides: improve content list view under reporting menu
This commit improves the list view of the contents under reporting menu
to make it simpler. Since we don't want to allow multi-edit here this commit
adds a different list view for reporting and binds it with the action.

Also, the action now excludes the sections from the result, and applies
default filter to see 'Published' content while landing as other content will
probably have no interesting statistics.

Also added float time widget for `completion_time` field.

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:35 +00:00
ijas ahammed 8f800a5ec0 [IMP] website_{slides,sale_slides}: improve course list view under reporting
This commit makes the reporting courses list view simpler, which now has
following fields:

- name
- user_id
- total_views (updated string to `# Views`)
- rating_avg_stars (updated string to `Average Review`)
- total_time (displays total)
- members_count (displays total and updated string to `# Attendees`)
- members_done_count (displays total and updated string to `# Completed`)
- product_sale_revenues (added from website_sale_slides with monetary widget)

This commit also adds a 'Published' filter to course search view
which is applied by default in report action for the courses.

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:35 +00:00
ijas ahammed ac3c4e6f67 [IMP] website_slides: improve content list view
This commit makes the content list view simpler, which now has following fields

  - name
  - channel_id
  - category_id (optional, default hidden)
  - user_id (with "many2one_avatar_user" widget)
  - is_published
  - date_published
  - completion_time (displays total and added float time widget)

Note that the view is now multi-edit, but we only want to update 'user_id' and
'is_published' fields in batch. So all other fields are readonly.

We have removed tracking from `date_published`, `website_published` field and
added tracking for `is_published` field. This information is sufficient.

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:34 +00:00
ijas ahammed fb372a69de [IMP] website_slides: improve course list and form view
This commit makes the course list view multi-edit (except 'name' field)
and moves the 'website_id' next to 'user_id'.

In form view: inside options page we have moved `enroll_msg` under to
`enroll_group_ids` to have all enroll options well displayed.

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:34 +00:00
ijas ahammed ce21cfb99c [IMP] website_slides: reorder eLearning settings
This commit reorders eLearning settings blocks, which now looks like

+----------------+-------------------+
| eLearning      |                   |
+================+===================+
|                |                   |
+----------------+-------------------+
| Certifications | Paid Courses      |
+----------------+-------------------+
| Mailing        | Forum             |
+----------------+-------------------+

TaskID-2607467

Part-of: odoo/odoo#76930
2021-11-23 09:39:33 +00:00
Fabio Barbero 8467ad6518 [IMP] website_slide: change sample text
Purpose
=======
Make placeholder look more like sample text to avoid users confusing it
with actual text, add "Sample" ribbon to default course context to avoid
confusing some users.

Specifications
=============
Change default placeholder text, add css rule for placeholders in
website_slide to make the colour lighter and disappear on focus.

PR: odoo/odoo/pull/78845
Task-2674361

closes odoo/odoo#78845

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-17 15:52:15 +00:00
Thomas Josse 63285ce026 [ADD] website_slides: merging slide.slide.link into resource
Purpose
=======
This commit is used to merge 2 models into 1: `slide.slide.resource`
and `slide.slide.link`

Specifications
==============
These models are merged in order to create a unique table for the
*Additional Resources* of a Content.

In order to do that, we merged the models into `slide.slide.resource`
that will contain either a link or a file.

task-2597345

See odoo/enterprise#20480
See odoo/upgrade#2784

Part-of: odoo/odoo#75646
2021-10-22 11:09:17 +00:00
Thomas Josse 91db19c187 [IMP] mass_mailing_slides / survey / website_forum / website_[sale_]slides_* : enhancing the views in eLearning
Purpose
=======
This commit is enhancing the website_slides module.

Specifications
==============
It changes placeholders for certain fields, it changes helpers in some
of the views.

It updates some of the main views of the menus and corrects wordings
inside of them.

It activates the Graph and Pivot views for the reporting of
Courses, Reviews and Quizzes.

It cleans up some of the measures inside of the Pivot and Graph views
of each menus where it is available.

It also merges 2 models: slide.slide.link and slide.slide.resource into
slide.slide.resource with a type Selection field.
This is done in order to create a single table for the additional
resources of a Content.

It also improves the front-end of the module with minor changes.
It fixes the problem of long names inside of breadcrumbs.
It also adds a message when there is no leaderboard in /profile/users.

task-2597345

See odoo/enterprise#20480
See odoo/upgrade#2784

Part-of: odoo/odoo#75646
2021-10-22 11:09:16 +00:00
Fabio Barbero 2d65d022d9 [IMP] website_slides: change confirmation messages for email
Purpose
=======
Clean up messages related to email verification.

Specification
=============
Rephrase messages, add confirmation of email sent and let user change
email.
Do not show "Validation Email sent" if the current user changed their
email address.

PR: https://github.com/odoo/odoo/pull/77617
Task-2647065

closes odoo/odoo#77617

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-12 11:44:40 +00:00
b63ee52552 [FIX] *: remove scss 'extend' from dropdown components
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.

Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.

In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.

Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.

// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
  <button class="dropdown-item" type="button">Action</button>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
  <li class="o_dropdown_item">
     <span>Action</span>
  </li>
  <li class="o_dropdown_item">
     <a href="#">Another action</a>
  </li>
</ul>

// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
  <span class="dropdown-item">Action</span>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)

closes odoo/odoo#77649

X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-04 07:57:00 +00:00
Nathan Marotte (nama) 77d6dff466 [FIX] website_slides : iframe code block appearing when pdfviewer loaded
Issue: When viewing a pdf in a website_slide, in certain conditions (
odoo detect the slide is externally embedded), a <iframe> code block
is displayed on the pdf rendering it really hard to read. As a work
around, one could click on the "<\> Embed" button to make it disapear

Steps to reproduce :
 1) Run a local odoo server with the website_slides module
 2) Set up a ngrox tunneling service to your localhost and good port
 3) Find or create a **document** slide and get its id (<slide_id>)
 4) Access the slide via the website url on the slide
 5) Go down the page in the Share tab and copy the iframe
  -Replace http by https in the src attribute of the iframe if necessary
 6) go back to the dashboard, open the inspector and add the iframe in
 the body of the webpage
 -> The slide is correctly detected as non embed
 7) Access your Odoo database with the ngrox https forward (example :
 https://0dfc-2a02-a03f-6b9b-b300-bd6c-8048-90f1-3f25.eu.ngrok.io)
 8) Repeat step 3 to 6 included
 -> The slide is detected as embed, so a <iframe> text area appears
 and make the pdf hard to read

Alternative steps to reproduce :
 1) Run a local odoo server with the website_slides module
 2) Go to the usual http://localhost:8069/ to access your database and
 navigate to a PDF slide in eLearning
 3) Change the localhost in the URL to 127.0.0.1 (Example
 http://localhost:8069/slides/slide/gardening-the-know-how-1 becomes
 http://127.0.0.1:8069/slides/slide/gardening-the-know-how-1) and press
 Enter to go to the new URL
 4) Change back the 127.0.0.1 to localhost and press Enter to go to the
 new URL
 5) You might have to repeat the back and forth between the two domains
 -> The slide is detected as embed, so a <iframe> text area appears
 and make the pdf hard to read

Why is that a bug:
 It makes the PDF unreadable unless we know that we must click on that
 button, it really shouldn't be like that

opw-2499110

closes odoo/odoo#76487

X-original-commit: cda27bc5535e0bb2a5191d89abf556d8c72025bd
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
2021-09-14 13:32:21 +00:00
Mathieu Duckerts-Antoine 7545913020 [REF] *: graph archs cleaning
We clean various graph archs taking into consideration that:
 - the default type of a graph is "bar".
 - a bar chart is by default stacked.
 - the field attributes type="row" and type="col" does not make sense for
   a graph view (since its implementation was separated from the pivot
   implementation a long time ago))
 - the boolean attributes should now take 1 or 0 as value (but the other
   values are accepted for retrocompatibility).

Part-of: odoo/odoo#76065
2021-09-07 15:50:14 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: website_blog, website_event, website_forum, website_sale,
website_slides)

Before this commit the search bar was specific to products.

After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".

In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.

The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Aurélien Warnon 344ad85c63 [FIX] website_slides: fix embed_code to be properly t-out'ed
Since 369075f

The slide.slide embed_code field is a HTML field.
Meaning that when it's used in a HTML block to embed content, it needs to be
correctly t-outed, the current t-esc code will just print HTML.

Task-2621278
2021-08-10 07:13:38 +00:00
Julien Banken 8ab2adfbdd [FIX] slides: prevent the # anchors of the PDF controllers from triggering a scroll jump
PURPOSE

Currently, the PDF viewer is loaded from an iframe and the PDF controllers
contains empty anchor links. When the user clicks on one of these links,
the browsers based on Chromium will trigger a "scroll jump" and the iframe
will be placed at the top of the browser window.

When the PDF document is larger than the viewport, this behavior can be
quite annoying: The user will have to scroll the browser window to
see the controllers each time they click on a controller (-> link) as
(1) the controllers triggers a scroll jump and (2) the controllers are
below the document that does not fit entirely on screen. To avoid that,
the links of the PDF controllers will be replaced with spans. The
controllers will then no longer trigger a scroll jump.

SPECS

- Replace the links of the PDF controllers with spans.
- Add css rules to prevent user selection.

LINKS

Task id: 2500574

closes odoo/odoo#73937

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-19 06:54:10 +00:00
std-odoo 97f0f648f1 [IMP] website_slides: open rating composer in fullscreen mode
Purpose
=======
Currently we can write a review in the slide fullscreen view.
But if we click on the button "review", we are redirected to the reviews
page. Instead, we want to open the rating composer and to stay in the
page.

Task-2322583
2021-07-16 11:18:11 +00:00
std-odoo db7b15988b [IMP] portal: allow better customization of the portal rating composer
Purpose
=======
Add a new option on the portal rating composer, "hide_rating_avg" in
order to hide the global rating on the button and allow to fully
customize the button. Also allow to customize the text style and to
add an icon on the button.

Add the dependency "portal_chatter.xml" from portal rating on the portal
composer Widget. It already has the dependency "portal_chatter.xml"
from the simple portal module, but because the second file was not in
the dependency, the view was not inherited if we add the widget in a
fullscreen view.

Task 2322583
2021-07-16 11:02:41 +00:00
Nicolas Lempereur 4aa89f146e [FIX] website_slides: can edit frontend enroll message
The frontend enroll message was display as a `<small/>` tag, but it
seems that lxml HTMLParser parse it wrongly, for example:

  html.tostring(html.fromstring('<small data-oe-model="test"><p></p></small>'))

returns:

  '<div><small data-oe-model="test"></small><p></p></div>'

So branding attributes like data-oe-model that are on small tag are not
found on root node that has become a `div` tag after parsing => this causes
a traceback error when saving a change in this part.

Fix: use small as wrapper for `<div/>` tag that is treated correctly by
HTMLParser (span is also treated correctly but div makes more sense
here).

opw-2573955

closes odoo/odoo#72315

X-original-commit: 6334c7282c19362ca8bc79dbaefe3d38c055e746
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-17 18:37:44 +00:00
Djamel (otd) ff29ec7064 [FIX] website_slides: hide the "Go to website" button if the slide is not saved
Steps to reproduce the bug:
- Go to Elearning > choose any course or create a new one
- Click on “add content” :
    - Add a title to slide
    - Click on "Go to Website"

Problem:
An error is triggered because we call the "create" method to save the slide, which tries to access the “channel_id”, the course ID in which the slide will be added. However, the field is not set in values.
The "create" or "write" function in "slide_channel" must first be called to save the course, which will then call the create function in "slide_slide"

Solution :
Hide the "Go to website" button as long as the course is not created and therefore has no id

opw-2526541

closes odoo/odoo#72199

X-original-commit: e412ba4898e35c8519adafb05407bdb78f311c09
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-15 18:31:14 +00:00
dht-odoo b8fb33817b [IMP] website_slides: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) slide.channel -> description
2) slide.channel -> description_short
3) slide.slide -> description

Task Id: 2499504

X-original-commit: 6d914c005183aa5ae69650e3002a5a85ca83b4a6
2021-06-07 05:24:08 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Thibault Delavallée bfbd42c5f4 [FIX] survey, website_slides: make invite coherent and improve templates
In this commit we fix some glitches in slide invite process

  * prevent from sending without recipients as it makes no sense;
  * hide Invite link in kanban like Invite button on form view, when not
    being invite-based;
  * fix small issues in various templates, notably escaping in subject;

Task ID-2534550 (Template usage improvement)
Task ID-2477164 (Composer mixin)
COM PR odoo/odoo#70889
2021-06-01 09:06:07 +00:00
Anjali d70af67954 [IMP] website_slides: show relevant info while viewing partners' courses
Currently, when you click the stat button "x Courses" on a contact, you land
on the dashboard of the courses that this user follows. But this information
in not much useful here. You'd like to see information like progress of this
member for each courses, or when the member was last active on a specific
course.

With this commit, when you click the 'x Courses' stat button from a contact,
you will see the list view of model 'slide.channel.partner', having the
default filter for the contact from which you clicked the button. This will
show the additional and relevant information you need, and by removing the
filter, you'll be able to see info about all the attendees and their progress
on courses they follow (Note that here if the partner is a company, you
won't get default filter set but the records will be filtered by domain,
because we need to show courses of current contact and it's children, and
so we have to set domain in action, instead of adding default filter in
action context).

The same way, on the Attendees View of a course (when seeing attendees from the
course dashboard), we add 'Last Action' field, and instead of fixed domain, we
use filter to view attendees of a particular course, removing which can allow
us to view information about all the attendees from all courses.

We also introduce new 'Attendees' menu under 'eLearning > Reporting' that will
show information about all the attendees from all courses, with a default group
of channels

Task Id-2409447

closes odoo/odoo#64152

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-17 09:12:26 +00:00
dht-odoo 12469ef4d3 [IMP] various: improve the sequence of menu items
- Currently all menus are out of order in app switcher.
- For example, Sales app is 16 menu away from Accounting,
  Social Marketing app is 25 menu away from Email Marketing, etc.
  So, all menus should be reordered.

- This commit will reorder the menus of the app switcher in order to reduce
  the distance between correlated applications,
  and bring the most common apps upward.
- And in this commit we have left gap of 5 subsequent sequence for further new menus.

PR: #69984
TASK ID: 2513082

Related: odoo/enterprise#17989
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 05:54:18 +00:00
Xavier Morel 369075fefb [FIX] website_slides: de-raw-ify
Convert `embed_code` to a computed HTML field so it's considered markup-safe.

It needs to be sanitize=False because we're putting <iframe> elements
in it. Those get stripped by sanitize.
2021-04-29 05:34:20 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Julien MougenotandSimon Genin ebe86f5ca5 [REF] web,*: Flatten _assets_helpers
Before this commit, the asset bundle "_assets_helpers" was the only
bundle using a "t-raw" directive to insert assets in between other asset
calls.

Now _assets_helpers only contains the assets called before the t-raw
directive, and the second part (1 file actually) has been added after
every call of the bundle.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Mariska ArchielliandThibault Delavallée 994cc3f5e6 [REF] website_slides: better integrate documentation and training channels
Purpose of this commit is to lessen difference in layouting between courses
being documentation or training. Indeed we want a smoother user experience.

In this commit we

  * use the left bar with course information on course page view on both
    courses;
  * unify menus and tabs;
  * better integrate sale and forum as everything is not a single layout;
  * move Type under Display to have all display related options within the
    same option group;
  * unify display, notably remove "+" on "+ Add Tags";

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
Thibault DelavalléeandMariska Archielli 7cba785900 [IMP] website_slides: allow to see document slides in fullscreen
Allow documentation lessons to be seen in fullscreen mode. Default mode
is still the slideshare-like one but fullscreen is now available. This
imply notably computing category data in both modes to enable fullscreen
support and course lessons navigation.

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
Michael Mattiello (mcm) 785b304876 [IMP] *: reduce shift in form views (xml)
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
  delivery, digest, event, event_crm, fleet, gamification, hr,
  hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
  mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
  purchase, purchase_requisition, sale_management, sales_team, sms,
  stock, stock_landed_costs, survey, website_crm_partner_assign,
  website_event_exhibitor, website_event_track, website_forum,
  website_slides, base

This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.

task 2330101
2021-02-02 12:40:22 +00:00
Xavier Dubuc d575cfb3c1 [FIX] website_slides: remove no more useful old activity overrides
task-2429670

closes odoo/odoo#64341

Related: odoo/enterprise#15674
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-01-19 11:43:47 +00:00
ijas ahammed 5e59ced9ca [IMP] website_slides: separate backend tags from frontend tags
Backend tags are generally used internally for classification or daily
process. Frontend tags are used for filtering and menu definitions. These
two type of tags are not managed separately in eLearning channels right now.

This commit separates backend and frontend tags using the color field.
Along with that, it improves the following :

Frontend

 - only displays channel tags that has color set;
 - avoids showing void tag group / menu (without any frontend tags);

Backend

 - prevents access of the backend tags for portal/public users with a
   record rule (similar to online events);
 - adds 'Tags (tag_ids)' field in the list view of 'Course Groups' that
   shows all the tags (frontend as well as backend);
 - hides the colorless tags in slide channel kanban;
 - improves the form view for course channel tags;

Frontend and Backend

 - adds a default color value while creating a new channel tag

Task ID-2357942
PR odoo/odoo#62138

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-23 14:49:28 +00:00
Nicolas Galler 9e574ebc07 [IMP] website_slides: add zoom controls, and set default zoom
- use a default scale when the viewer is shown, to fit the document to
the available space
- avoid using CSS scaling on the canvas, as this makes the output blurry
- add some zoom controls in the viewer
- fix CSS class for icon on the full-screen toggle (this toggle was
previously not displayed because of it)
- move download button left (to avoid overlapping with "Chat with Us"
box on odoo.com)

opw-2389716

closes odoo/odoo#62836

X-original-commit: 0247a94f252186aae33f5f137021fa04747fa2fb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2020-12-03 14:40:43 +00:00
75b4e2dd38 [IMP] portal, website_slides: send message without reloading page
1) in this commit, improved portal chatter for messaging. when the user sends a
message, the new message is updated in history without reloading page.
instead of submitting a form which reloads page to send message we added rpc call
to send message.
2) rating on courses is implemented by extending portal chatter, applied changes in
website_slides to do reviews without reloading page
3) refactoring: cleaned or removed code
eg. removed form and some input fields as data is not submitted as form anymore,
introduced some methods to avoid duplication of code

task-2054662
Closes https://github.com/odoo/odoo/pull/47746

closes odoo/odoo#47746

Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Co-authored-by: ktr-odoo <ktr@odoo.com>
Co-authored-by: Siddarth Gajjar <sga@odoo.com>
2020-11-30 11:22:13 +00:00
Jeremy Kersten 0ca248892f [FIX] website*: fix quick create (o_new_content) performance
Before, on request by groups, now we use a variable is_system / is_designer
to make only once the request.

closes odoo/odoo#62313

Related: odoo/enterprise#14970
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-25 13:10:39 +00:00
Benoit Socias 20141a0b91 [FIX] various: not translate the close icon of notifications
Same change in several areas where translations existed:
- website editor notification popup
- elearning share popup
- forum remediation filter popup
- event registration attendees popup
- portal rating popup
- stripe payment error popup
And many other locations where there were no translations yet
"&times;" has been replaced by its UTF8 character.
Also introduced aria-label where missing.

Before this commit the close icon was included in translated resources.
For example, in Spanish the "&times;" had been turned into "&veces;"
thus not rendering an icon anymore

After this commit the close icon is not a translated text anymore and
remains an icon across all languages

https://github.com/odoo/odoo/pull/60186
task-2312878

closes odoo/odoo#62250

X-original-commit: 9896af94ebc887d98ccf44e6568ef7eeb5a27172
Related: odoo/enterprise#14937
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-24 15:59:43 +00:00
Siddarth Gajjar 1e9ae791c3 [IMP] website_slides: beautify tags URL
Before this commit when searching channels based on tags URLs were generated
like `/slides/all?tags=%5B4%5D`. This is not very clean, especially when
people share links.

In this commit we move to a slug-based URLs generation and support. URLs now
look like `/slides/all/tag/basics-1,gardening-2` which is more readable and
user friendly.

Support of all tags is maintained: `/slides/all?tags=%5B4%5D` still work
and display the same as `/slides/all/tag/basics-1,gardening-2` to ensure
links still work after applying this patch.

Along with this improvement this commit also improves the behavior of tags
for bot indexation. This is inspired by website_blog[1].

Task ID-2267840
Closes #53621

[1] - https://github.com/odoo/odoo/commit/0f2cada32319b3910d6ace6d412cfa94a646c9c7

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-10 08:55:18 +00:00
IEL 3c7694b409 [FIX] *: fix image parsing error on saving res config
WHAT: apply 93a7695f65baf00d1f82481d6a2a97e6c11940a8 for all res.config.settings
menus

WHY: the same reason as in 93a7695f65baf00d1f82481d6a2a97e6c11940a8:

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

it may lead to image dissapearing or "Incorrect padding" error

HOW:

    find . -iname "*.xml"|xargs grep "\"context\".*'module'" -l | xargs sed -i "s/\(\"context\".*'module'.*\)\}/\1, 'bin_size': False}/"
    git checkout  -- addons/base_setup/views/res_config_settings_views.xml

---

PR for General Settings: https://github.com/odoo/odoo/pull/47297

opw-2346644

closes odoo/odoo#61215

X-original-commit: 7c55efa88b72bd1f3f0f32f7f738e2fda5aa4abd
Related: odoo/enterprise#14547
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 18:25:20 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Aurélien Warnon 0bac777154 [FIX] website_slides: hide "responsible" label if no responsible assigned
This commit makes a small adjustment to the course view to hide the responsible
label in the course description if none is set.

As this field is not required on the slide.channel model, it's not necessary to
show a useless label when it's not set.

Task 2368573

closes odoo/odoo#60611

X-original-commit: 7114e13736d41f2350b14367704bf14c23cf9c0d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-10-23 11:41:15 +00:00
Hiral Bhavsar 23ffc7f5b6 [FIX] mail, website_slides: fix while accept the request from the new attendee
Before this commit:

We have a new feature that if the course is private, and attendee make the
request to access the course it will create an activity for 'course responsible'.

Currently, after accepting the invitation request from the new user, it is still
not considered the user as an attendee and not displaying like 'You're enrolled'
to the respective users

After this commit:

The features of access invitation on courses will be workable.

Task-2328389

closes odoo/odoo#60135

X-original-commit: becf051f38fcf08d4a0aea758cb2758ad0f25bc3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-15 19:40:29 +00:00
Priyanka Kakadiya 8d4393d834 [FIX] website_slides: properly display muted text in full-screen
Since a refactoring of the handling of the color system and the way the text
muted is handled, the text-muted isn't visible on the full-screen mode of a
course. That is becuase text-muted is based on the font color set for the body,
which in this case is quite similar to the background of left panel in
full-screen course content.

This commit fixes the issue by using `text-600` class that is suited for this
scenario (the background color is fixed here irrespective of the color-palette,
and so should be muted text-color) instead of `text-muted` for the left panel
of full-screen course content.

taskId - 2346013
closes #59390

closes odoo/odoo#59970

X-original-commit: 7f7f9c6c9165fc6697e90ed6616466d9684e28f2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 10:33:27 +00:00