diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py index 7b05ed91584..f3fc22784f5 100644 --- a/addons/website_slides/models/slide_slide.py +++ b/addons/website_slides/models/slide_slide.py @@ -135,7 +135,7 @@ class Slide(models.Model): ('video', 'Video'), ('quiz', "Quiz")], string='Type', required=True, - default='document', readonly=True, + default='document', help="The document type will be set automatically based on the document URL and properties (e.g. height and width for presentation and document).") index_content = fields.Text('Transcript') datas = fields.Binary('Content', attachment=True) diff --git a/addons/website_slides/static/src/js/slides_share.js b/addons/website_slides/static/src/js/slides_share.js index 423b84bda1b..3157604e34e 100644 --- a/addons/website_slides/static/src/js/slides_share.js +++ b/addons/website_slides/static/src/js/slides_share.js @@ -50,48 +50,12 @@ sAnimations.registry.websiteSlidesShare = sAnimations.Class.extend({ * @param {Object} parent */ start: function (parent) { - var self = this; var defs = [this._super.apply(this, arguments)]; defs.push(new ShareMail(this).attachTo($('.oe_slide_js_share_email'))); - if ($('div#statistic').length) { - this.slideURL = $('div#statistic').attr('slide-url'); - this.socialURLs = { - linkedin: 'https://www.linkedin.com/countserv/count/share?url=', - twitter: 'https://cdn.api.twitter.com/1/urls/count.json?url=', - facebook: 'https://graph.facebook.com/?id=', - }; - } - - _.each(this.socialURLs, function (value, key) { - self._updateStatistics(key, self.slideURL); - }); - return $.when.apply($, defs); }, - //-------------------------------------------------------------------------- - // Private - //-------------------------------------------------------------------------- - - /** - * @private - * @param {string} socialSite - * @param {string} slide_url - */ - _updateStatistics: function (socialSite, slideURL) { - var self = this; - $.ajax({ - url: self.socialURLs[socialSite] + slideURL, - dataType: 'jsonp', - success: function (data) { - var shareCount = (socialSite === 'facebook' ? data.shares : data.count) || 0; - $('#' + socialSite + '-badge').text(shareCount); - $('#total-share').text(parseInt($('#total-share').text()) + parseInt($('#' + socialSite + '-badge').text())); - }, - }); - }, - //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- @@ -101,14 +65,11 @@ sAnimations.registry.websiteSlidesShare = sAnimations.Class.extend({ * @param {Object} ev */ _onSlidesSocialShare: function (ev) { - var self = this; ev.preventDefault(); - var key = $(ev.currentTarget).attr('social-key'); var popUpURL = $(ev.currentTarget).attr('href'); var popUp = window.open(popUpURL, 'Share Dialog', 'width=626,height=436'); $(window).on('focus', function () { if (popUp.closed) { - self._updateStatistics(key, self.slide_url); $(window).off('focus'); } }); diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml index b2dd1585ff0..1bb07a32a6d 100644 --- a/addons/website_slides/views/slide_slide_views.xml +++ b/addons/website_slides/views/slide_slide_views.xml @@ -71,13 +71,13 @@ - + + attrs="{'required': [('slide_type', 'in', ('video'))], 'invisible': [('slide_type', 'not in', ('document', 'presentation', 'video'))]}" /> - diff --git a/addons/website_slides/views/website_slides_templates_lesson.xml b/addons/website_slides/views/website_slides_templates_lesson.xml index 0853c8dccb9..77e154b1ccc 100644 --- a/addons/website_slides/views/website_slides_templates_lesson.xml +++ b/addons/website_slides/views/website_slides_templates_lesson.xml @@ -185,7 +185,7 @@
-

+

mr-1 @@ -245,36 +245,7 @@

-
- -
- -
@@ -409,6 +359,35 @@
+
+ +
+
+
+ External sources + +
+
+ Rating +
+
+ + + + + + + + +
+
+
+
@@ -427,7 +406,7 @@ t-att-data-has-next="1 if next_slide else 0" t-att-data-next-slide-url="'/slides/slide/%s' % (slug(next_slide)) if next_slide else None">
+ t-att-class="'o_wslides_js_lesson_quiz_question my-5 %s' % ('completed-disabled' if slide_completed else ('disabled' if not slide.channel_id.is_member else ''))" t-att-data-question-id="question['id']" t-att-data-title="question['question']">
.
diff --git a/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml b/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml index 5d92dfb32ae..7022de0df99 100644 --- a/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml +++ b/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml @@ -3,6 +3,9 @@