summaryrefslogtreecommitdiff
path: root/addons/website_slides/static/src/js
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-02-28 15:54:15 +0000
committerThibault Delavallée <tde@odoo.com>2019-03-04 16:28:27 +0000
commitdc76c99a1e6508f24ea059f08fa48975cbfcaff5 (patch)
treec9dd7e5bb46eb488d6d832c887b3a818b3052dd0 /addons/website_slides/static/src/js
parenta488cf67ed5ddb3f67e545176039cc12ac6ed7c2 (diff)
[FIX] website_slides: fix display of lessons in training course
Currently slides are displayed in a reorderable list, using current user access rights. This means external customers see only published and free lessons. However purpose of course page is to display all lessons, and display only available ones as clickable. Other one should be displayed as muted to tease people. Note that a specific lesson page does check for access rights. Here we just display all lessons names. A label for free preview is also added. Fetch of data when displaying a channel is therefore a bit modified as there are less differences between training and documentation channels. User progress is also updated to be easier to use in templates. Commit linked to task ID 1941250 and PR #31453
Diffstat (limited to 'addons/website_slides/static/src/js')
-rw-r--r--addons/website_slides/static/src/js/slides_course_slides_list.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/addons/website_slides/static/src/js/slides_course_slides_list.js b/addons/website_slides/static/src/js/slides_course_slides_list.js
index 756026b5a0c..93376a08d31 100644
--- a/addons/website_slides/static/src/js/slides_course_slides_list.js
+++ b/addons/website_slides/static/src/js/slides_course_slides_list.js
@@ -28,17 +28,17 @@ sAnimations.registry.websiteSlidesCourseSlidesList = sAnimations.Class.extend({
* @private
*/
_bindSortable: function () {
- this.$('ul.o_wslides_slides_list_container').sortable({
+ this.$('ul.o_wslides_js_slides_list_container').sortable({
handle: '.fa-arrows',
stop: this._reorderCategories.bind(this),
items: '.o_wslides_slide_list_category'
});
- this.$('.o_wslides_slides_list_container ul').sortable({
+ this.$('.o_wslides_js_slides_list_container ul').sortable({
handle: '.fa-arrows',
- connectWith: '.o_wslides_slides_list_container ul',
+ connectWith: '.o_wslides_js_slides_list_container ul',
stop: this._reorderSlides.bind(this),
- items: '.o_wslides_slides_list_slide:not(.o_wslides_empty_category)'
+ items: '.o_wslides_slides_list_slide:not(.o_wslides_js_slides_list_empty)'
});
},
@@ -50,8 +50,8 @@ sAnimations.registry.websiteSlidesCourseSlidesList = sAnimations.Class.extend({
* @private
*/
_checkForEmptySections: function (){
- this.$('.o_wslides_slides_list_container ul').each(function (){
- var $emptyCategory = $(this).find('.o_wslides_empty_category');
+ this.$('.o_wslides_js_slides_list_container ul').each(function (){
+ var $emptyCategory = $(this).find('.o_wslides_js_slides_list_empty');
if ($(this).find('li.o_wslides_slides_list_slide[data-slide-id]').length === 0) {
$emptyCategory.removeClass('d-none').addClass('d-flex');
} else {
@@ -130,7 +130,7 @@ sAnimations.registry.websiteSlidesCourseSlidesList = sAnimations.Class.extend({
* @private
*/
_updateHref: function () {
- this.$(".o_wslides_slides_list_slide_link").each(function (){
+ this.$(".o_wslides_js_slides_list_slide_link").each(function (){
var href = $(this).attr('href');
var operator = href.indexOf('?') !== -1 ? '&' : '?';
$(this).attr('href', href + operator + "fullscreen=1");