Commit Graph
837 Commits
Author SHA1 Message Date
qmo-odoo c564ae6c87 [IMP] website_slides: Add elearning feature to slides
Purpose of this commit is to introduce a new way of displaying and managing
slides in eLearning module. Its purpose is to give a better experience to
users when going through a course. Notably a fullscreen mode allows to take
lessons one by one without going out of the elearning display. Integration
of all slide types eases taking the course step by step.

Quiz are introduced in this commit. Those are an addition to slides with
some question / answers (multiple choice). It allows customer to gain karma
and improves gamification. Certifications are still done using the survey
application. Quiz targets only small tests at the end of a given slide.

A new widget is added to display and control slide display in fullscreen
mode. Old display is still available for documentation channels or when
going out of fullscreen mode, to see details on comments / review / statistics
and have access to share options.

This commit is linked to task ID 1902304 and PR #29876. It closes the main
work on refactoring website slides into eLearning, with other tasks already
merged in current community [1][2][3][4][5].

[1] Task ID 1940360 landed at b2149bc7a2: certification inclusion
[2] Task ID 1936153 landed at 6c6179e57c: homepage inclusion
[3] Task ID 1937160 landed at 8b7605c9e5: selling courses
[4] Task ID 1922159 and 1940516 landed at 5fa651cb01 and 6a64c3ce82:
    new user profile and gamification of slides / forum
[5] Task ID 1938643 landed at 77b5673a0d: upload channel/slide
2019-02-19 13:11:15 +00:00
Aurélien Warnon 3c88e75c86 [FIX] website_slides: handle publishing rights of channel/slide
Purpose
=======

Handle publishing of the slide.slide/slide.channel accordingly to the new
'can_publish' field in the website published mixin.
2019-02-19 07:08:03 +00:00
David Beguin 3ab9f1d8ab [IMP] website_slides_forum : set communication on slide.channel at creation - frontend side
Since 556b6454dab07cdf716d404ec0db9aa51a09b165, channel can be linked to a dedicated forum.
But the link could only be done in backend, in the slide.channel configuration
For now on, website_publishers can create a new dedicated forum when they create
a new slide.channel.

Link buttons have been added in both forum and slide.channel headers to navigate easily
between them.

Fix the relation between course and forum in a model point of view.

Task ID : 1922159
PR #31109
2019-02-18 15:15:02 +00:00
David Beguin 705376a982 [IMP] website_slides : add karma gain rules
To gamify the new elearning, karma can be gained on various actions
- rank a slide_channel (course)
- vote for a slide
- finish a course

This commit also fix the 'completed' computation on slide.channel.partner

Task ID : 1922159
PR #31109
2019-02-18 15:01:40 +00:00
Thibault Delavallée 0fe26b382c [FIX] website_slides: fix computation of completed courses 2019-02-18 14:53:10 +00:00
David Beguin 16b0b18361 [IMP] website_slides : show completed and ongoing course on profile
Two new sections are added in the profile page : Completed courses and Followed courses
Thoses sections replace the former 'Courses' section.

Use span instead of b tag in profile page

Task ID : 1922159
PR #31109
2019-02-18 12:16:08 +00:00
Thibault Delavallée 5822e3098c [FIX] website_slides: fix text / html mismatch in demo data
Slide description is actually a text field, no need to put html tags that
are displayed raw.

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:46:03 +00:00
Thibault Delavallée bd2dae4f6d [IMP] website_profile, website_slides: add user ranking and karma on elearning main pages
Purpose of this commit is to improve karma and gamification inclusion in
elearning [1].

 * remove a border, replaced by a standard hr, in rank template. It allows to
   reuse it easier as we don't necessarily want that border in other templates
   using it;

Commit linked to task ID 1941250 and PR #31133.

[1] task ID 1922159 (landed at 5fa651cb01)
2019-02-15 17:45:55 +00:00
Thibault Delavallée 1bb7b242c0 [FIX] website_profile, website_slides: clean user avatar controller and add one for slides
Purpose of this commit is to

 * clean user avatar controller and its calls;
 * extract default image computation;
 * add a controller to get slide image even when not having access to the slide
   as all slide name and images are displayed even if not available to the
   current user;

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:45:41 +00:00
Thibault Delavallée 6a9f6876c1 [FIX] website_slides: fix some statistics and publication issues
This commit fixes various issues introduced by recent commits in slides

 * fix slide type computation: using a dict in a fromkeys makes a shared
   object for all keys. It is better to fix that behavior;
 * correctly display number of course steps in elearning homepage. Currently
   number of steps of a course is simply the length of its one2many;
   holding slides. However this one depends on access rights which give funny
   results like a course with 2 steps for public users and 7 for admin;
   Right computation is: number of published lessons, whatever your access
   rights are. This is already computed as total_slides;
 * people that cannot publish should not be able to unpublish;

Commit linked to task ID 1941250 and PR #31133.
2019-02-15 17:44:02 +00:00
Aurélien Warnon 171c7028dd [FIX] website_slides: fix channel statistics computation
Purpose
=======

Channel statistics computation in the _compute_slides_statistics method
did not work for a batch of channels.

(The stats dict was shared for all the channels).
2019-02-15 15:32:47 +00:00
Aurélien Warnon f322816ae8 [ADD] website_slides_survey: add a new bridge between slide and survey
Task #1940360
Subtask of #1902304

Purpose
=======

Adds certification capabilities to the website_slides module.
Channel/courses can now include certifications as a new type of slide.

This new type of slide is available as a "Certification" button on the slide creation
frontend view (next to "Video", "Presentation", ...).
Users have to link the slide to an actual survey that has the 'certificate' field
set to true (that will populate the slide's survey_id field).

Slides of type certification are handled in frontend in a very simple way for now:
- A button "Begin certification" that redirects the user to the related survey frontend.
- A button "Download certification" when the user has succeeded the certification.
- When the survey is done, if it's linked to a slide, a button "Go back to course" allows
  the user to go back to the slide frontend.

(There is a special use case for when the website_publisher designing the survey lands on a
certification slide: he is allowed to test the survey with a survey_input created as test_entry)

Survey creation as well as limited time, limited number of attempts, ... are still completely
handled in the survey module. That means that the user will have to first create a suitable survey
that is a certification and only then create a slide of type "certification" and link
the created survey to it.

Ideally, the taking of the survey should be transparently included in the slide frontend but
it requires a full refactoring of the way surveys are submitted. This will most likely come in
a later commit.

This commit is an advanced merge of full eLearning module (see task #1902304).
2019-02-15 15:32:46 +00:00
Aurélien Warnon dcce7716b3 [IMP] website_slides: support slide_type param in slides/all route
Task #1940360
Subtask of #1902304

Purpose
=======

The slide/all route now supports a 'slide_type' param that will filter channels
to contain at least one slide of type 'slide_type'.

This is a preliminary work for the slides_survey bridge.
2019-02-15 14:59:32 +00:00
Aurélien Warnon 949f641254 [FIX] website_slides: fix publisher slides frontend access
Purpose
=======

Website publisher should be allowed to access slides on the frontend even if
he's not a member of the channel.
2019-02-15 14:04:52 +00:00
Aurélien Warnon 1cb7290c20 [IMP] website_slides: add visibility criteria to some slide fields
Task #1940360
Subtask of #1902304

Purpose
=======

Some fields displayed on the slide.slide form view are not relevant
for all slide_types and should be hidden.
2019-02-15 12:54:00 +00:00
Thibault DelavalléeandAurélien Warnon 8f295a64f3 [REF] website_slides: propose new shiny (incomplete) demo data
Purpose of this commit is to rewrite slides demo data. More channels, more
slides, more images, less Odoo oriented content.

Everything is still not completely clean but at least it begins to look like
something we could show to people. Thanks to @awa-odoo who gave some demo
data. No thanks to @xmo-odoo who did not give demo data about the emu war.

This commit is linked to task ID 1936153 and PR #30770.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2019-02-15 09:58:26 +00:00
Thibault Delavalléeandqmo-odoo 2cfacfc632 [IMP] website_slides: new homepage and main channel page
This commit proposes a new homepage for slides module evolving towards
an eLearning platform. It includes

* a new main page displaying top courses / channels. It displays 3 most
  popular and newest channels as well as its ongoing courses (if logged).
  Achievements and karma update done by eLearning community allow to give
  a gamification look and feel;
* an 'All' page displaying all courses / channels. Tag groups and tags
  allow to search / filter displayed courses;
* a new pimped and revamped display for main course / channel page;

For more details about specifications, send an email to aware people that
will be able to send you mockups. Or see the related task. Thanks to
@qmo-odoo who helped developing this homepage based on its work.

This commit is linked to task ID 1936153 and PR #30770.

Co-Authored-By: qmo-odoo <qmo@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2019-02-15 09:58:26 +00:00
Thibault DelavalléeandAurélien Warnon c437832e55 [REF] website_slides: perform some model code cleaning
This commit squashes several fixes / light improvements related to the new
slides / elearning homepage [1][2].

Containing notably

 * clean promote strategy field on channel model: less entries as they
   are now used only to display lessons in a given order on channels of
   documentation type;
 * remove promotional fields, not used anymore since partial access on channel
   allowing to have some kind of small preview of slides has been removed;
 * use standard image field (image, image_medium and image_small) and use
   image_resize_image from tools like all other odoo applications;
 * improve image resizing to have medium images better looking on frontend
   and use that nice image_large that broke my build yesterday;
 * add last publication date change on channel;
 * clean dead code;

[1] new homepage task: ID 1936153 and PR #30770
[1] main elearning task: ID 1902304 and PR #29876

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-15 09:58:25 +00:00
Thibault Delavallée c971b622c0 [IMP] gamification, website_slides: add challenges in slides and improve ranks
Purpose of this commit is to add challenges related to slide / elearning
module. 5 new challenges with their badges are added. Portal user partner
is now also published to have bioutifoul demo data. Commit linked to
eLearning tasks [1][2]

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>

[1] new homepage task: ID 1936153 and PR #30770
[2] new user profile / gamification task: ID 1922159 and PR #30514 and #30988
2019-02-15 09:57:46 +00:00
jem-odoo 8ad65abd00 [IMP] website_slides: allow comments on slides
With this commit, the user can activate review on channel content when
creating a channel from frontend, or editing it from backend. Once
activated, the comment tab below the slide content will allow user
to post a comment with optional rating.
The way of commenting is different regarding channel type:
- documentation: user can post comment and vote (list/dislike) on
slide content
- training: user can post comment with review (rating)

Task-1902304
2019-02-14 15:27:35 +00:00
jem-odoo 1878ea95fe [IMP] website_slides: allow to set cover image for webpage slide
Before this commit, the user can only create a webpage slide
by setting its name, category and tags. On the channel grid,
no tumbnail was shown.
This commit allow the user to upload a cover image from the
slide upload modal and to modify it from form view. the
mimetype of webpage slide is now 'forced' through the
modal to 'text/html' to avoid conflit with 'image/png'
when setting the cover image.

Task-1902304
2019-02-14 09:32:43 +00:00
Aurélien Warnon 2d83482b9f [FIX] website_slides: count non-members views as public views
Task #1940360
Subtask of #1902304

Purpose
=======

Slide views made by non-members of the channel (typically the website_publisher
designing the survey) should be counted in the "public_views".

closes odoo/odoo#31096
2019-02-14 09:09:20 +00:00
David Beguin d8f156ae73 [IMP] website_slides : use website_profile page template and adds website_slides specific information
Adds slides ands slide.channels specific information (courses) into the website_profile template page.

As there can be more than one slide.channel,the profile page shows everything linked to every slide.channel,
except if the channel_id is given in url arguments.

Adds the 'Go to eLearning' button in the 'new rank reached' mail to encourage the users to continue
to be active on the eLearning platform as well, to gain more karma point and improve there rank.

Task ID : 1922159
PR #30988
2019-02-14 09:24:10 +00:00
Aurélien Warnon 8e2c67005e [IMP] website_slides: add is_preview management in backend/frontend
Task #1902304

Purpose
=======

The 'is_preview' field implied some functional behavior but it was not
manageable from back-end nor front-end.

It can now be configured on the slide upload form (front-end view) and on
the slide form (back-end view).

closes odoo/odoo#31073
2019-02-13 14:32:41 +00:00
Thibault Delavallée 752a3a5169 [FIX] website_slides: improve can upload / publish computation
New rules are

 * on channel type documentation: can upload like before (employee or upload
   groups specified); can publish like before (can upload and publisher)
 * on channel type training: can upload like before (employee or upload
   groups specified); can publish restricted to channel responsible

Tests are added.

This commit is a sub-part of task ID 1902304 (main eLearning task).

closes odoo/odoo#31082
2019-02-13 18:20:05 +00:00
Thibault Delavallée 370c525d77 [FIX] website_slides: fix computation of members
Members is better computed using a sudo to avoid every access rights issues.
Moreover trigger is updated so that cache is correctly invalidated and
recomputed. Having the trigger on the relational model correctly triggers
the recompute when calling main API methods to add a channel member.

This commit is a sub-part of task ID 1902304 (main eLearning task).
2019-02-13 18:20:05 +00:00
Aurélien Warnon 82ce815a8c [REF] website_slides: rework slide's public and embedded views
Purpose
=======

A slide's 'Embedded views' are reworked as 'Public views' to simplify
the model and be more compliant with the new 'is_preview' field.

The rule is now the following:

A slide is a preview or the view is done as public user (once per session)
-> increment public_views

A slide is viewed as a logged in user that has access to the content
-> increment slide_views
Technically slide_views is a compute of the slide_slide_partner count.

Tests are also added to ensure it is effectively working.

This commit is a sub-part of task ID 1940360 (eLearning integration with
survey) and task ID 1902304 (main eLearning task).
2019-02-13 18:20:05 +00:00
Thibault Delavallée 752c8925ea [FIX] website_slides: fix typos
Othrewsie you colud have some isuses.

closes odoo/odoo#31020
2019-02-12 11:24:30 +00:00
qmo-odoo 1b1732beb5 [IMP] website_slides: new modal to upload a document
With new slide type, it was required to change the
upload modaL. Now, the use select first the type
of document he wants to upload, then the correct
form appears. When filled, user can sumbit it to
be redirect to the slide he just create.

Task-1938643
2019-02-12 11:23:13 +00:00
qmo-odoo 0f22f95289 [IMP] website_slides: webpage slide type
The idea is a slide can be a HTML page completely customized by
user. So, you can now easily create custom content and publish
it on your website, like a normal slide.

Task-1938643
2019-02-12 11:22:59 +00:00
qmo-odoo b8a24751c2 [IMP] website_slides: remove unique slide name constraint within channel
Having a unique constraint for a slide name in a channel look strange.
It force an RPC call to check this when uploading a slide, making the
process a little bit slow.
Morevover, name is a translatable field on slide.slide model, so the
constraint can not be fully respected.

To simplify the model, we decided to remove this.

Task-1938643
2019-02-12 11:22:59 +00:00
qmo-odoo 5aa645c89f [IMP] website_slides: add external links on slide
A slide can now have some external link. For instance, links to
the origin of the document (sources for scientifics papers, ...).
A new model is added to allow the user to provide several link
per slide. Those are display below the channel on website page.

Task-1938643
2019-02-12 11:22:59 +00:00
qmo-odoo c2a38e4602 [IMP] website_slides: create channel in frontend
This commit provides the abilty to create channel from the website
instead of creating a slide. To do so, the user still have the "upload"
button on the channel home page.
The new modal allow user to set title, description, type and channel
tags. We prevent channel tag and group tag creation on the fly, as it
can impact the UI (coming in a future commits).

Task-1938643
2019-02-12 11:22:55 +00:00
Aurélien Warnon 9352bb682f [IMP] website_slides: improve channel's "members_count" computation
Task #1937160

Purpose
=======

Performance improvement:

The members_count computed field now uses a compute_sudo with
a read_group allowing to compute all the members_count of the recordset
in a single query.

closes odoo/odoo#31013
2019-02-12 09:22:29 +00:00
Aurélien Warnon a15810e0c2 [IMP] website_slides: add a setting to install website_sale
Purpose
=======

With the new 'website_slides_sale' module users can now sell slide.channels.

This commit adds a setting to let the user know he has to install website_sale
to be able to sell courses / documentation.
2019-02-11 17:47:35 +00:00
Aurélien Warnon e5536fc07b [IMP] website_slides: add invite wizard for 'invite' slide_channel
Purpose
=======

Currently, the slide_channels having a visibility configured as 'invite' could
only add members manually.

This commit adds an 'Invite' button on top of the slide channel form that opens
a wizard allowing to send emails to contacts and also make them members of the
related slide channel.
2019-02-11 17:47:22 +00:00
Aurélien Warnon 779d9c9b90 [IMP] website_slides: add a "Attendees" stat button on slide.channel
Task #1937160

Purpose
=======

This commit adds a "Attendees" stat button on the slide.channel form view
showing the members (partner_ids) count.

On click, it redirects to a tree view of slide.channel.partner. The tree
view is configured as editable to be able to administrate members
(add/update/delete).
2019-02-11 17:47:10 +00:00
Aurélien Warnon 9b7bee73e5 [ADD] website_sale_slides: allow to sell slide.channel
Task #1937160

Purpose
=======

This commit adds sale capabilities to a slide.channel. A slide.channel can
now have the 'payment' visibility, that requires a 'product_id' configured
on the channel.

When a customer purchases a product linked to a channel, he is added to the
members of the channel (see slide.channel.partner_ids) when his order is
confirmed.

The feature is added in a new module 'website_sale_slides' that comes as a
bridge auto-installed between 'website_slides' and 'website_sale'.

The final goal is to be able to sell "courses" (see task #1902304).
2019-02-11 17:46:40 +00:00
Thibault Delavallée 7b81df3747 [REF] website_slides: remove promoted slide feature, add image and channel_type
Purpose of this commit is to clean a bit channel model. Promoted slide
feature is removed as people can already choose an order for a given
channel. Moreover promoted slide will not be used when having a eLearning
display of a channel.

Image field on channels is added as it is not depending on promoted slide
anymore.

To simplify future additions a search-specific template is removed to
have a unique template to display a channel content. It will ease future
merge.

This commit is linked to task ID 1936153 and PR #30985.
2019-02-11 09:55:15 +00:00
Thibault Delavallée 7ee22f1219 [IMP] website_slides: improve and add statistics computation
Purpose of this commit is to add some statistics computation on slide.channel
model. We want notably to have a count of views and votes (likes and dislikes)
on channels. Completion is also computed.

Purpose is to be able to search and order channels based on those statistics.
Having stored computed fields for some statistics help achieving that purpose.

Tests are added.

This commit is linked to task ID 1936153 and PR #30985.
2019-02-11 09:55:12 +00:00
Thibault Delavallée cbc2de0eb6 [IMP] website_slides: add tags and tag groups on channel
Purpose is to be able to filter, search and categorize channels. Notably
with eLearning in mind there will be more channels as a channel will also be
used to hold lessons.

For that purpose we add a model of tag linked to channels. Those tags are
organized by groups in order to be able to display them using a menu or
a small hierarchy of tags. Displaying a tag group as a specific navigation
element is controlled by a specific field.

Those models will be used to display a new and improved home page for
channels / courses.

This commit is linked to task ID 1936153 and PR #30985.
2019-02-11 09:55:05 +00:00
Thibault DelavalléeandAurélien Warnon a20408e995 [FIX] website_slides: reflect ACLs on fields for channel members
Just reflect access rights: publishers should be able to manage channel
members.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>

closes odoo/odoo#30960
2019-02-08 16:26:44 +00:00
Thibault DelavalléeandAurélien Warnon 8d310d1a88 [FIX] website_slides: improve methods to add members on channel
To avoid security issues or exploits, public method to add a member on a
channel allows to add only itself, under given restrictions, like being
a channel maintainer to add self on a private channel.

A private method allow to subscribe other people. It will be used notably
to allow publishers to invite other people.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-08 16:26:39 +00:00
Thibault Delavallée 6b46422a6b [REF] website_slides: update slide members relationship
This commit changes decorated many2many between slides and participants
recently introduced [1]. It was done between slide and users as people have to
login to have slide information.

Another many2many between channel and partners to store notably completion
and soon add statistics has been added [2]. It has been done between
channels and partners.

In this commit we choose to have the same relationship for slides, aka a link
between slides and partners. It allows to easily compute statistics and find
information based on partner_id.

Co-Authored-By: Quentin Mourrier <qmo@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>

[1] See c273e89d55
[2] See 748b9072d6
2019-02-08 16:26:28 +00:00
David Beguin 723789b6b1 [FIX] website_slides: Fix clean ACLs and refactor access options commit
Fixes related to commit 748b9072d6

 * fix template still having an unnecessary t-else whereas the t-if has
   been removed;
 * move order by strategy on right class;
 * fix access rights on intermediate model between channels and partners. It
   should be accessible to website publisher as they will have so manage
   channel members;
 * fix some typos;

closes odoo/odoo#30949
2019-02-08 12:01:12 +00:00
Aurélien Warnon c4c067509e [REM] website_slides: remove the 'state' field of slide.channel.partner
Purpose
=======

The 'state' field for a member of a channel did not imply anything functionally
so we decided to remove it. It allows to remove an unnecessary computed fields.
ACLs are updated accordingly.

If needed, we will soon be able to check partner_ids that have ordered but
not paid a channel / course product by searching the related 'sale.order' model
for such products.
2019-02-08 11:33:09 +00:00
Thibault Delavallée 29219b9c93 [IMP] website_slides: remove duplicated code
Code probably coming form a rebase conflict. Duplicated and therefore removed.

closes odoo/odoo#30921
2019-02-07 13:58:57 +00:00
Thibault Delavallée 797daba163 [IMP] website_slides: add widget to join a channel
Purpose is to add a new widget and its route allowing to join a channel.
As visibility is now mainly based on membership a widget to join channels
is required.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Thibault Delavallée ddccd33bae [IMP] website_slides: improve upload slide screen
Slide upload access is a bit cleaned. A can_publish field is added controlling
who can publish slides. Currently website publishers are allowed to publish
content. Not publishers people allowed to upload cannot publish their own
content. It stays in a submitted non published state.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Thibault Delavallée b91add891c [IMP] website_slides: add tests
Currently website_slides module lacks tests. This commit adds base for tests
and add some tests related to recently cleaned access rules and rights.

Future commits will gradually add more tests to the module as it evolves
towards a more broad and up-to-date application.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:45:57 +00:00