PURPOSE
Allow to manage attachments when updating a frontend review.
SPECIFICATIONS
Currently when posting a review in eLearning or eCommerce one can attach
files to its review thanks for portal composer. Rating popup composer allow
to update its comment and rating. However this edit mode has two limitations.
It does not display attachments previously added and does not allow to add
attachments.
This commit fixes that by
* giving attachment values to the composer, allowing its display by the
composer display at startup;
* allowing to give new attachments and properly handle them in slides
route;
Uploaded and validated attachments cannot be removed by users. Indeed
message with attachments has probably already be sent to people and removing
attachments would lead to information loss.
LINKS
Task 2066600 (manage attachments)
Task 2058595 (eLearning v13 testing)
Purpose of this commit is to add new content at last position in frontend.
Indeed backend uses last position in embedded list view, frontend should
do the same. Moreover when having a lot of content, having everything at
the bottom of the screen at the same position of Add content / section
buttons makes sens.
Specifications
* when adding a new category: add it as last category;
* when adding a new slide in a category: add it as last slide of the
category;
Specific case of slide without category
* when adding a new slide without category: add it as last slide of the
channel (display it as last) but keep it on top in backend view
(display as first);
Improve content list display in frontend of eLearning
* contents without section are now at the bottom;
* fixed alignment of buttons icon (Add Content and Add Section)
* fixed broken design because of title too long
Task 2049640 (website slides back2basics and fiximp)
Task 2061672 (new content bug report)
Co-Authored-By: Michaël Mattiello <mcm@odoo.com>
Co-Authored-By: Alexis Lacroix <laa@odoo.com>
Before this commit, leaderboard was displayed only if user was not connected.
As we feel this is very interesting to show we decided to display it in all
cases (either connected or not) on eLearning frontpage. Activating it is
now done using an entry in the customize menu.
Task 2005981
closesodoo/odoo#35791
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Before it was not possible to leave a course.
- This commit adds a modal to give the members the possibility to leave
the course and also subscribe or unsubscribe to get notified or not.
+ Display a warning message when leaving if field enroll value is "payment".
task-1985511
in this commit, we have set the correct attribute(field's name) to fix
the traceback while we adding a new section on a course using website
task-2053822
closesodoo/odoo#35786
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Ease discovering of eLearning features by allowing to install surveys
directly from frontend in order to allow certification.
SPECIFICATIONS
Add a button in Upload a document to install Surveys. This button only
appears if surveys is not installed.
When button is clicked, ask for confirmation before installing survey.
LImitate this feature to group system: system people should see the button
and use standard ACLS about module installation.
LINK
Task ID 2026846
The 'index_content' field was only filled when uploading from the frontend.
That would lead to inconsistent results when creating/updating 'presentation' slides from the slide.slide form view.
The field was also not cleaned if the slide content changed.
As it's usage was not very clear (only on a 'search', and not very intuitive), we simply removed the field.
The completion time of a slide now has default values for slides of type
* video (duration of the YouTube video);
* PDF (number of pages * 5 minutes);
This computation is done when uploading a slide in frontend or by an onchange
in backend. Field can still be given / modified by elearning people as
result may not be reliable (pdf parsing is not accurate, and/or you may
estimate time differently from strict page-based computation).
The course will sum up all durations of its (active) slides. Display has been
changed from "x minutes" to "x hours y minutes".
Task ID 2007294
When uploading twice the same video for a channel, the error message displayed unhandled html.
We removed the html to avoid having to use $el.html() for better safety (and it should not happen often anyway).
PURPOSE
Like already done for sale order, invoice of survey, purpose of this commit
is to remove category model and replace by a flagged line (slide). It allows
to easily reorder slides in an embedded list view.
SPECIFICATIONS
Instead of having a fully fledged slide.category model, slide.slide will serve
that purpose with a is_category flag. This will allow to drag and drop slides
and sections in the channel form view.
This change had an impact on the way slides were added/sorted on the front-end.
In fact, whenever a slide is added from the front-end, a resequencing of all
the slides in the course has to be triggered.
Category of a slide is now a computed field based on the sequence. Order
of slides is based on sequence, with categories splitting the slide list based
on is_category flag.
In this commit tests are added. Some cleaning in tests is also performed to
speedup a bit tests (savepointcase) and some cleaning / renaming to ease
their understanding.
Future commit will add JS necessary to manage slides in the section list view.
LINKS
TaskID: 1978731
PR: #33255
PURPOSE
eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.
SPECIFICATIONS
Update manifest and make website_slides an application separated from
website embedded menus.
Implement new menu structure
* Courses
* Courses
List view: Course Name, # Views, # Attendees, # Ratings, Revenues,
Reviews
* Contents
* Reporting
* Courses: list view on slide.channel model, ordered by # views.
* add a graph view (group by content)
* Contents: graph view on slide.slide model
Area Graph: X month
Y measure: # Views (others measures: Attendees, ...)
Group by: course (color)
* Reviews: see kanban of latest reviews;
* Quiz: list view on slide.question model.
List view: Add # Quizz Trials, # Quizz Passed, Avg Attempts
* Configuration
* Settings
* Allow Forum on Courses (installs website_slides_forum)
* Allow Certifications (installs website_slides_survey)
* Allow Selling Courses (installs website_sale_slides)
* Course Tags
* See channel.tags.group with label Course Tags, form view allow to
configure group tags
* https://drive.google.com/a/odoo.com/file/d/1G0g2UnG5cZG55EXQ5icbgwe7T2eSZskT/view?usp=drivesdk
* On click: open :https://drive.google.com/a/odoo.com/file/d/1I_PW3aZAbrslXadiYqmVF-_6dGXx8knd/view?usp=drivesdk
* Content Tags
This structure will gain new items in sub-modules, notably bridge with
form and website_sale. Those will be implemented in next commits.
LINKS
Task 1978729
PR #35061
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
The `website_published` field from the website's mixins is basically a readonly
from `is_published` field.
On read, this field will simply read `is_published` and check if the record's
website_id is accessible (only for the multi mixin).
On write, it will always write on `is_published`.
This commit improves a few things:
- A lot of code was writting on website_published which was just then writting
on is_published. Writting directly on is_published makes more sense.
- Some backend fields would still reference `website_published` instead of
`is_published` which would just go through the related for no reason.
Plus, using `is_published` will make the field tooltip more accurate as we
are not in a website context ('Visible on current website' to 'Is Published')
- Filter and search on tree view were still using the `website_published`
related field, which is just a readonly when we are not in a frontend
context.
- Some create and write function would have security check on
`website_published` value but that was wrong as the user could bypass that by
simply writting on `is_published`. For the write method, check `is_published`
is more accurate as it will cover both case since `website_published` will
then call the write method on `is_published`
The following models are already using big images, or they might need big images
in the future:
- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank
PR: #34925
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
what was previously the big size)
+ add new intermediate format:
image_512
PR: #34925
A share button has been added to the fullscreen view to avoid
exiting the view to access the share tab on the full description
of the slide.
Task ID : 1984509
closesodoo/odoo#33418
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to ease slides / lessons management in eLearning
frontend.
The publisher will now be able to see if a slide is in preview mode from
the slide list in frontend of eLearning.
He'll be able to activate/deactivate the free preview mode with a button.
Task 1999705.
closesodoo/odoo#34182
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Indeed we don't rate slides, we rate courses. Therefore rating mixin is not
necessary as well as access token.
Access token field as we are using the _mail_post_access and a karma check.
Commit linked to task 1952064.
This commit improves the elearning onboarding on the quizzes
If the user is not logged in, a log in button will show up under
the quiz
If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz
If the course needs to be bought, a buy button will appear under the quiz.
If the course is on invite only, a message under the quiz will inform the
user about it
TaskID: 2003986
PR: #33861
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Contains some small fixes
* correctly order leaderboard by descending karma, not creation date;
* top 3 users displayed in footer banner should be published, otherwise
displayed images do not match the top 3 displayed in the page displayed
when clicking;
* correctly say Leaderboard is an overall leaderboard, not only limited
to the current week;
Linked to task 2005840
Related to PR #34220
before this commit:
When a user tries to see an archived slide, it throws an internal server error
instead of 404 page
after this commit:
404 page will be shown if a slide is archived
task- 2018147
closesodoo/odoo#34198
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When the channel has a linked forum, the "Review" link on the forum should redirect the user
to the "Review" tab on the course page.
Task #2003222closesodoo/odoo#33786
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
This commit improves the footer image of the slides home page by adding
the top 3 users avatars (ordered by karm desc) in the image.
We only fetch users that have an image set as avatar.
Task #2003222
Co-authored-by: @stefanorigano <sri@odoo.com>
When joining a course of liking a slide if the user is not logged there
is a popover asking him to login. If auth signup allows user creation
link instead redirects to signup instead of login to save a click and
improve onboarding.
closesodoo/odoo#33755
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In the backend, the user has the possibility in the channels list to drag and drop
channels to define their order, thanks to the `sequence`.
This order was then not respected in the front-end when displaying the slides channel
`/slides/all`.
This was basically not possible for the user to control the order in which
the channels were displayed.
With this revision, when the order is not specified to the controller,
or is wrong, it fallbacks to `None`, which therefore follows the slides channel natural
order, which is `sequence, id`. The user can now control the order of the slides channels
in the front-end.
closesodoo/odoo#33745
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* = tools, base, web, website_profile, website_slides
Before this commit it was impossible to pass those parameters in the URL because
they were received as string but expected as int.
The opportunity is also taken to properly use named parameters when calling
`image_process`.
closesodoo/odoo#33506
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit removes the read access on slide.answer for all
users except website_publisher and admin
Task: #1947884
PR: #32083
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* = website_profile, website_slides
Before this commit, the returned Content-Type was not always correct, for
example if the image tool was changing the format, which happens when given
a BMP (converted to PNG), or other types being converted to JPEG.
The previous method `force_contenttype` was too specific and it wasn't available
in every controller. It didn't even need to be a controller method because it
didn't use self.
Now we create a generic helper to ease updating headers.
The Content-Type is only updated when it is safe to do. It is especially unsafe
for example for SVG files.
task-1958000
PR: #31811
* = hr, im_livechat, mail, payment, purchase, web, web_editor, web_unsplash,
website_profile, website_slides
Since the merge of all image tools into one function, the intermediary functions
are not needed anymore.
task-1958000
PR: #31811
* = website_partner, website_profile, website_sale, website_slides
Before
======
Since commit: 2e3848b394
The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.
With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.
Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.
It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.
After
=====
This commit will solve all of those problems by always keeping the ratio of the
original image.
This implies the views should be taking care of adding borders when necessary.
task-1958000
PR: #31811
There is a mix in the variable names: before this commit, what is called
`image_base64` is actually not base64 encoded, and what is called `content` is
actually base64 encoded.
The variables have been renamed to avoid further confusion.
task-1958000
PR: #31811
This commit provides a few fixes for quiz feature:
* fix amount of karma won by the user in a quiz;
* correctly display the fact that a subquiz was completed by the user instead
of just looking like a non-completed quiz;
* going on a previously completed quiz, good answers are hightlighted and
inputs disabled;
* effectively put the quiz in readonly mode if not a channel member.
Commit linked to task ID 1941250 and PR #31977
- Fix certification card in user's profile page
Since design review, certification card were not displaying well.
This commit applies the course card template on certification card
and modifies the way the certification get downloaded by calling directly the
controller instead of using class catched in javascript that calls afterward the
controller.
- Allow review button only if allow_comment in FS mode + redirect url
'write a review' button in fullscreen mode must not be displayed if the course
is not in allow_comment mode. Also, the url if this button was redirecting
to slide view in non fullscreen mode. As no review can be done from this point,
the url redirect now to the course view.
- Fix fullscreen slide height.
- Fix all slides view per category pager and page rendering
Since the introduction of categorized data dictionnary that is given to the template,
if a category is empty, it's rendered anyway, which is good for publisher,
to quickly see all existing categories.
But other users should not see those empty categories.
Also, if the slides from a course are filtered (with View all button) by category,
all the slides should be reachable, using the pager. This was not the case as
categorized slides dictionnary returned no slides if page <= 2.
(as bound of array was from offset to limit and offset and limit were equals)
The number of slides per category must be overwritten if search category is activated,
to see more than the 4 first slides of the category.
Finally, if search category is activated, only the target category should be displayed,
and not the others, for performance reason.
- Show 'not verified' next to user's name if user karma = 0
Instead of using the email_validation_done flag. As email validation is only used
to offer the user some karma in order to be able to interact in the forum or eLearning.
If the user already has karma, he is already considered as active and 'verified'
- Correct URL of certification in FS mode
Task ID : 1941250
Closes PR #31567
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Commit 5798ca28bf was assuming the vote and
comment access on slide was related to is_preview mode and was, consequently,
depending on each slide separately.
In fact, it's not because a slide is in preview mode that the user has the right
to vote for this slide. He must be course member to interact with this preview
slide, even if he has the right to read it.
So the vote and comment right are now computed at the level of the course,
and apply to all the slides of this course.
This commit also reviews and apply fixes on review - rating access.
Here are the applied rules regarding vote, comment and rating on course and slides:
A user can review a course:
- If allow_comment is activated on the course AND
- If the user is publisher OR
- If the user has enough karma AND is member of the course.
Note : if the rating is not allowed on the course, not only the button
to review must be hidden but also the entire rating composer.
A user can vote and comment a slide:
- If allow_comment is activated on the course AND
- If the user is publisher OR
- If the user has enough karma AND is member of the course.
Other fix applied is this commit :
- Avoid crash when no promoted slide : When going on course homepage
(documentation type), if no promoted slide, we got a internal server error.
Task ID: 1941250
Partial revert of commit 5798ca28bf
PR #31567
Before this commit, in fullscreen mode, clicking on the "pass certification"
button would redirect the user to the "non-fullscreen" view.
After this commit, the button directly redirects the user to the survey page.
To avoid generating user_input of survey (test entry or not) for
certification slides in fullscreen mode (table of content), we decided
to create those user_input lazily: we redirect the user to a route that
create (or reuse) the correct user_input.
Task-1946511
For now, in no fullscreen mode, if the quiz is succeed, the
user progress is not updated because the quiz is not set
to done.
This commit implements this call to mark slide as done and
green the check bullet.
We decided to unify the submit RPC call with the done one,
so a quiz (or a slide with questions) can only be done when
submitting answers. As consequence, we need to prevent some
slide type to use the /set_completed route (quiz and certif).
Task-1941250
Purpose
=======
The quiz_submit method and the action to set the quiz done both use
the slide_partner relation that has to be accessed in sudo mode.
Task-1941250
As slides are returned in sudo to the template, the user rights were
checked via a can_access variable set in the template directly.
In order to disable the vote for user that cannot get access to the course
all the checks are now done in backend (also to avoid to get access to slides
in sudo mode with rpc calls). We add now, for each slide on the course view,
the access and vote rights to the template : can_access and can_vote.
Those two are computed in backend, using the user's access right instead of admin's.
But, as if the user is not member of the channel, he cannot get access to the
course slides (expect for Free Peview ones), so the check on can_vote
will crash. This is why we check the access rights before checking can_vote,
for each slides (as free preview slides are still accessible,
even if the user is not in channel members).
The vote widget is disabled if user's can_access or can_vote = False, enabled otherwise.
If user have access but have not enough karma, the controller will handle this
case and return an error to the user telling him he has not enough karma to vote.
If user can vote but cannot access, the controller will handle this
case and return an error to the user telling him he has no access to the lesson.
Task ID: 1943788
PR #31321
To avoid eLearning to be spammed, the comment, review and vote behaviours
are now allowed only if the user has enough karma to do it.
Here is the new behaviour on courses and slides rating / comment / vote
-If allow_comment is checked on Course :
- Review (rating) is allowed on Course only if enough karma
- Comment is allowed on slides within the course
only if enough karma and course type is 'training'
- Vote is allowed on slides within the course
only if enough karma and course type is 'documentation'
-If allow_comment is not checked on Course :
- Review (rating) is not allowed on Course
- Comment is not allowed on slides within the course
- Vote is not allowed on slides within the course
- Rating is not allowed on slides within the course anymore
Task ID : 1943788
PR #31321
This commit adds the search bar in 'All users' page in order to filter on name or company name.
To be able to keep the position, a non stored computed field has been added on res_users
to get the position depending on the user's karma.
The podium (top 3 users) is now displayed only if there is no search applied and if the page = 1
because it has no sens anymore in other cases.
Special thanks to @jem-odoo who helped me finding smart solution for position computing.
Task ID : 1943788
PR #31321
Email validation was necessary on the forum to be able to begin to use the forum
(ask or answer questions, vote, etc..)
As the new elearning also uses karma since 705376a982,
the email validation is now also necessary in the eLearning platform.
This is why this commit is moving the email validation process to website_profile
and extend website_slides (eLearning) and website_forum to use this feature.
In function of where the user asked to send him the validation email,
the user is redirected on the forum or on the elearning when he clicks on
'Validate my account' in the received 'email validation' email.
Task ID : 1943788
PR #31321
This commit makes the 'Fullscreen' page a complete odoo
widgets. We decided to split it into some sub widget:
- Fullscreen: will be the master piece, handle communication of
components, displaying slide content, setting slide as completed,
handling server RPC calls, ....
- Sidebar: responsible for slide navigation, based on the table of
content. (prev, next, keyboard naviguation, ...)
- VideoPlayer: display content for Youtube video and handling player
event to auto set as completed, ...
The DOM of this page is still rendered serverside. DOM was cleaned in
order to be less complex and less deep. CSS style was also reviewed
to decrease line of code.
Fullscreen is now completely using Quiz widget with events triggered.
Task-1942852