Skip to content
Snippets Groups Projects
  1. Mar 21, 2019
  2. Mar 20, 2019
  3. Mar 19, 2019
    • David Beguin's avatar
      [FIX] website_slide{_survey} : apply various fixes on elearning views · a13e33dd
      David Beguin authored
      
      - 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: default avatarThibault Delavallee (tde) <tde@openerp.com>
      a13e33dd
    • David Beguin's avatar
      [REF-FIX] website_slides : review and fix access, vote, comment and rating · 12fd6a01
      David Beguin authored
      Commit 5798ca28 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 5798ca28
      PR #31567
      12fd6a01
    • sri-odoo's avatar
      [IMP] website_profile: merge ranks/badges pages · 8ecff655
      sri-odoo authored
      Merge ranks & badges pages. This commit adapt the final page
      layout, controllers and templates.
      
      Added the badge category filter. If used in url parameter, hide ranks and show
      only the badge part of the page, filtered on matching badge_category.
      
      Task ID : 1941250
      PR #31567
      
      Co-authored-by: @stefanorigano
      Co-authored-by: @dbeguin
      8ecff655
  4. Mar 18, 2019
    • Aurélien Warnon's avatar
      [IMP] website_slides_survey: handle certification re-enroll/purchase flow · 199ecdd3
      Aurélien Warnon authored
      Task #1945036
      
      Purpose
      =======
      
      If the user fails his last attempt at a course certification, we remove him from
      the members of the course (and he has to enroll again).
      He receives an email in the process notifying him of his failure and suggesting
      he enrolls to the course again.
      
      The purpose is to have a 'certification flow' where the user can re-purchase the
      certification when they have failed it.
      
      This could lead to some issues if the course containing the certification also has
      other slides with content because the user will not have access to them after failing.
      This also prevents configuring courses with multiple certifications since the membership
      will be removed at the first failure.
      
      These use cases are considered "non standard" by the business and are thus not handled
      in the code. We assume that users will configure their courses "correctly".
      199ecdd3
  5. Mar 17, 2019
  6. Mar 15, 2019
    • qmo-odoo's avatar
      [FIX] website_slides_survey: certification slide url · e8e8d7a9
      qmo-odoo authored
      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
      e8e8d7a9
    • Jérome Maes's avatar
      [FIX] website_slides: avoid putting unexisting attribute on object · 34f72667
      Jérome Maes authored
      In this computed field, an attribute is assigned to the record
      but this attribute does not exist. Python authorized this but
      this makes the code ugly and this is definitely not a good
      practice.
      
      Task-1941250
      34f72667
    • Jérome Maes's avatar
      [FIX] website_slides: prevent to mark a certification as done · 954e8ca6
      Jérome Maes authored
      When a certification slide is display in no fullscreen
      mode, the done button is clickable. Same applies to quiz
      slide.
      This commit prevents user to manually mark a slide as done
      for slide type that requires an other action (submit answer,
      pass survey, ...).
      
      Task-1941250
      954e8ca6
    • Jérome Maes's avatar
      [FIX] website_slides: auto set done successfull quizz · 32c5632a
      Jérome Maes authored
      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
      32c5632a
    • Aurélien Warnon's avatar
      [FIX] website_slides: avoid access error when submitting quiz · 55f61d95
      Aurélien Warnon authored
      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
      55f61d95
    • sri-odoo's avatar
      [IMP] website_slides: embedded player restyling · 54261c4e
      sri-odoo authored
      The style and DOM structure of the embeded player (used
      to display PDF file) is old, and it needed a little refresh
      to be adapt to bootstrap4 and modern styling.
      
      Task-1941250
      54261c4e
    • sri-odoo's avatar
      [FIX] website_slides: styling fullscreen mode · 69fb136a
      sri-odoo authored
      Since the fullscreen widget has been revamped, it needed
      to be pixel perfect. This commit cleans the CSS and DOM
      structure in order to optimize and sublime it.
      
      Task-1941250
      69fb136a
    • David Beguin's avatar
      [IMP] website_slides : improve get slide access computation · 5798ca28
      David Beguin authored
      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
      5798ca28
    • David Beguin's avatar
      [IMP] website_slides : allow review, comment and vote only if enough karma · d4db21a9
      David Beguin authored
      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
      d4db21a9
    • David Beguin's avatar
      [FIX] website_slides : fix and add tests on karma gain · 81cebf34
      David Beguin authored
      Fix karma channel completion computing and karma gain :
          set to complete only if not completed
          and handle eventual multi course completion
      Removes unused karma gain rules.
      Add karma unvote rule to loose the karma gained if user changes his mind.
      Test karma gain on each users.
          Note : technically, public user could be member of a course,
          but functionally speaking, this case should and could never happen
          (it's a non sens anyway)
          -> public user has not been tested for this reason.
      
      Task ID : 1943788
      Closes PR #31321
      81cebf34
    • David Beguin's avatar
      [IMP] website_profile, gamification, : add search bar in all users page · d7cc1520
      David Beguin authored
      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
      d7cc1520
    • David Beguin's avatar
      [IMP] website(_profile,_forum,_slides): move validation email to profile and... · fb40c6bf
      David Beguin authored
      [IMP] website(_profile,_forum,_slides): move validation email to profile and use in forum and elearning
      
      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 705376a9,
      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
      fb40c6bf
  7. Mar 12, 2019
    • qmo-odoo's avatar
      [FIX] website_slides: no completion for public user · 24d30331
      qmo-odoo authored
      
      When a slide is seen by user, it should be marked as completed
      (according to its type), and the user completion for the course
      is updated. But for public user, we don't want those RPC calls
      to be done, as completion for visitor makes no sense.
      This commit also hide progressbar when current user is public.
      
      Task-1942852
      
      closes odoo/odoo#31700
      
      Signed-off-by: default avatarJérome Maes (jem) <jem@openerp.com>
      24d30331
    • qmo-odoo's avatar
      [REF] website_slides: revamp fullscreen widget · fd78a408
      qmo-odoo authored
      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
      fd78a408
  8. Mar 08, 2019
    • Thibault Delavallée's avatar
      [IMP] website_slides: display a flag for unpublished lessons in course list view · bccfe8a4
      Thibault Delavallée authored
      It helps course maintainers understanding the state of their lessons.
      
      Commit linked to task ID 1941250 and PR #31708.
      bccfe8a4
    • Thibault Delavallée's avatar
      [FIX] website_slides: fix domain computation of a channel slide list · 6b7eeac5
      Thibault Delavallée authored
      When displaying a channel content all its slides are displayed in a
      list view or cards view. Even slides current user cannot read because
      he is not member of the channel are displayed, even if there is no link
      (and access rights prevent them for effectively accessing the slide).
      Purpose is to display a channel content without giving access through
      ACLS at its slides.
      
      However this domain computation was not correctly matching real use case
       * publishers should see everything;
       * public users should not see unpublished slides;
       * members not publishers should not see unpublished slides unless they
         uploaded it;
      
      Commit linked to task ID 1941250 and PR #31708.
      6b7eeac5
    • Thibault Delavallée's avatar
      [REF] website_slides: extract code to have slides per category · edf68bde
      Thibault Delavallée authored
      Purpose of this commit is to have a method allowing to fetch slides
      and have them ordered by category with some info on the category. It
      fully supports uncategorized slides.
      
      This commit also fixes the lessons list view of a training course. When
      having rights to edit the channel the category name was not editable.
      We now use a real browse record allowing to edit the category names
      directly in this reorderable list view.
      
      Commit linked to task ID 1941250 and PR #31708 .
      edf68bde
    • Thibault Delavallée's avatar
      [FIX] website_slides: various fixes · 7afd23e5
      Thibault Delavallée authored
      
      Display
       * improve color of trophy displayed on top of course main page (success if
         course done, warning while working on it);
       * correctly fetch and display karma/xp points on course lesson list. It is
         either gain of next try, either awarded points depending on slide
         completion;
       * fix control buttons in course main page (prev, next, set done,
         set completed, fullscren), notably correctly set them disabled;
      
      Linting / Code
       * put demo in no update;
       * rename some parameter in website_slides_survey to avoid conflict between
         quiz (on a slide) and certification (a survey);
      
       Commit linked to task ID 1941250 and PR #31697.
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      7afd23e5
    • David Beguin's avatar
      [IMP] website_(profile, slides): add custom pager to show on all users / courses pages · 6091062e
      David Beguin authored
      If there are too much users to show on the page and to avoid performance
      issues, a pager is now applied on the all users page.
      
      A new pager based on website_pager is added in order to ease the navigation
      through the potential high number of pages. 'Go to first page' and 'Go to last
      page' buttons have been added and the design of the pager have been adapted
      to be more integrated into the new eLearning platform.
      
      Also add the pager on the slide page if search category is applied. The pager
      was already computed in the controller but not displayed.
      
      Task ID : 1946160
      PR #31697
      6091062e
  9. Mar 07, 2019
    • Thibault Delavallée's avatar
      [REF] website_slides: rework standard lesson page view · 20e68b32
      Thibault Delavallée authored
      
      Purpose of this commit is to perform a cleaning and upgrade of the lesson
      view in front-end when not using the fullscreen mode. This page had not
      been updated since eLearning addition.
      
      A method is added on slide model to have a protected method computing quiz
      related information on a given set of slides, notably potential karma gain,
      gained karma and number of attempts. It is mainly a code move from controllers
      now working in batch.
      
      Some linting is also done, notably a badly-named file.
      
      See original eLearning task for main specifications [1].
      
      Commit linked to task ID 1941250 and PR #31657.
      
      [1] See task ID 1902304
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      20e68b32
  10. Mar 17, 2019
  11. Mar 07, 2019
    • Jérome Maes's avatar
      [REF] website_slides: redesign quiz widget · 3393dd00
      Jérome Maes authored
      
      This commit makes the quiz widget a real odoo widget that triggers up some
      events. The widget is now only responsible of
      
       * fetching quiz data (if not given)
       * decorating the anwsers according to the result
       * displaying message (error or modal)
      
      To do so, some code move/rewrite was needed
      
       * extract and factorize some template
       * add 'sudo' on technical model to avoid access rights error
       * factorize some python method from controller to model
       * remove some CSS classes to lighten the code
       * fixing access model error
       * make quiz widget handle the display of error message
       * give browse record for template rendering, rather than slug
       * cleaning some spaghetti code in Fullscreen widget
       * ...
      
      Commit linked to task ID 1941250 and PR #31584.
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      3393dd00
    • Thibault Delavallée's avatar
      [FIX] website_slides: correctly return deferred when calling slide routes in fullscreen · 47b308d8
      Thibault Delavallée authored
      I promise to fix all deferred. Huk huk huk.
      
      Commit linked to task ID 1941250 and PR #31584.
      47b308d8
  12. Mar 06, 2019
    • David Beguin's avatar
      [FIX] gamification, website_profile : re-fix division by zero if user has no karma · 1949c796
      David Beguin authored
      If a new user try to access the elearning platform or his porfile, if he has
      no karma, has it is the case for new users, he won't get any rank. So that
      the next rank karma minus current rank karma equals zero.
      
      To avoid this, next_rank will always be first one existing if the user has no
      karma. Also, the current rank will not be displayed if the user has no karma.
      finally, next rank will not be displayed if the user reached the last existing
      rank.
      
      Task ID : 1941250
      PR #31512
      1949c796
Loading