diff options
| author | David Beguin <dbe@odoo.com> | 2019-03-08 14:41:55 +0000 |
|---|---|---|
| committer | David Beguin <dbe@odoo.com> | 2019-03-15 15:05:54 +0000 |
| commit | d4db21a9cc89bc09acb64f8743bf12df910abc96 (patch) | |
| tree | 61cb18759a4c27884ed7c55c19f77e0d390d3ca9 /addons/website_slides/static/src | |
| parent | 81cebf3485684243b366a60741e45c4744ccf494 (diff) | |
[IMP] website_slides : allow review, comment and vote only if enough karma
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
Diffstat (limited to 'addons/website_slides/static/src')
| -rw-r--r-- | addons/website_slides/static/src/js/slides_slide_like.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/website_slides/static/src/js/slides_slide_like.js b/addons/website_slides/static/src/js/slides_slide_like.js index d5afc5c4409..bb0542a5f7e 100644 --- a/addons/website_slides/static/src/js/slides_slide_like.js +++ b/addons/website_slides/static/src/js/slides_slide_like.js @@ -59,6 +59,10 @@ var SlideLikeWidget = Widget.extend({ self._popoverAlert(self.$el, _.str.sprintf(_t('Please <a href="/web/login?redirect=%s">login</a> to vote this slide'), (document.URL))); } else if (data.error === 'vote_done') { self._popoverAlert(self.$el, _t('You have already voted for this slide')); + } else if (data.error === 'comment_disabled') { + self._popoverAlert(self.$el, _t('Votes and comments are disabled for this channel')); + } else if (data.error === 'missing_karma') { + self._popoverAlert(self.$el, _t('You don\'t have enough karma to vote')); } else { self._popoverAlert(self.$el, _t('Unknown error')); } |
