-
-
+
+
@@ -153,12 +248,20 @@
How to upload your videos ?
-
First, upload your videos on YouTube and mark them as unlisted. This way, they will be secured.
-
What does unlisted means? The YouTube "unlisted" means it is a video which can be viewed only by the users with the link to it. Your video will never come up in the search results nor on your channel.
-
+
On YouTube
+
First, upload your videos on YouTube and mark them as unlisted. This way, they will be secured.
+
What does unlisted means? The YouTube "unlisted" means it is a video which can be viewed only by the users with the link to it. Your video will never come up in the search results nor on your channel.
+
+
+
On Google Drive
+
+ The Google Drive link can be obtained by using the 'share' button in the Google interface.
+ It should look similar to
+ https://drive.google.com/file/d/ABC/view?usp=sharing
+
-
-

+
+
@@ -179,7 +282,7 @@
Test your students with small Quizzes
-
With Quizzes you can keep your students focused and motivated by answering some questions and gaining some karma points
+
With Quizzes you can keep your students focused and motivated by answering some questions and gaining some karma points
@@ -188,4 +291,14 @@
+
+
+
+
+
+
+ Loading content...
+
+
+
diff --git a/addons/website_slides/tests/common.py b/addons/website_slides/tests/common.py
index c7815b3ef95..73111d1eda1 100644
--- a/addons/website_slides/tests/common.py
+++ b/addons/website_slides/tests/common.py
@@ -55,7 +55,7 @@ class SlidesCase(common.TransactionCase):
cls.slide = cls.env['slide.slide'].with_user(cls.user_officer).create({
'name': 'How To Cook Humans',
'channel_id': cls.channel.id,
- 'slide_category': 'presentation',
+ 'slide_category': 'document',
'is_published': True,
'completion_time': 2.0,
'sequence': 1,
@@ -70,7 +70,7 @@ class SlidesCase(common.TransactionCase):
cls.slide_2 = cls.env['slide.slide'].with_user(cls.user_officer).create({
'name': 'How To Cook For Humans',
'channel_id': cls.channel.id,
- 'slide_category': 'presentation',
+ 'slide_category': 'document',
'is_published': True,
'completion_time': 3.0,
'sequence': 3,
diff --git a/addons/website_slides/tests/test_karma.py b/addons/website_slides/tests/test_karma.py
index d2df3b38d3d..a9453da8caf 100644
--- a/addons/website_slides/tests/test_karma.py
+++ b/addons/website_slides/tests/test_karma.py
@@ -28,14 +28,14 @@ class TestKarmaGain(common.SlidesCase):
self.slide_2_0 = self.env['slide.slide'].with_user(self.user_officer).create({
'name': 'How to travel through space and time',
'channel_id': self.channel_2.id,
- 'slide_category': 'presentation',
+ 'slide_category': 'document',
'is_published': True,
'completion_time': 2.0,
})
self.slide_2_1 = self.env['slide.slide'].with_user(self.user_officer).create({
'name': 'How to duplicate yourself',
'channel_id': self.channel_2.id,
- 'slide_category': 'presentation',
+ 'slide_category': 'document',
'is_published': True,
'completion_time': 2.0,
})
diff --git a/addons/website_slides/tests/test_slide_utils.py b/addons/website_slides/tests/test_slide_utils.py
index aa82e1abb65..df47492403a 100644
--- a/addons/website_slides/tests/test_slide_utils.py
+++ b/addons/website_slides/tests/test_slide_utils.py
@@ -168,8 +168,8 @@ class TestSequencing(slides_common.SlidesCase):
class TestFromURL(slides_common.SlidesCase):
- def test_youtube_urls(self):
- urls = {
+ def test_video_urls(self):
+ youtube_urls = {
'W0JQcpGLSFw': [
'https://youtu.be/W0JQcpGLSFw',
'https://www.youtube.com/watch?v=W0JQcpGLSFw',
@@ -188,9 +188,27 @@ class TestFromURL(slides_common.SlidesCase):
],
}
- for id, urls in urls.items():
+ Slide = self.env['slide.slide'].with_context(website_slides_skip_fetch_metadata=True)
+
+ # test various YouTube URL formats
+ for youtube_id, urls in youtube_urls.items():
for url in urls:
- with self.subTest(url=url, id=id):
- document = self.env['slide.slide']._find_document_data_from_url(url)
- self.assertEqual(document[0], 'youtube')
- self.assertEqual(document[1], id)
+ with self.subTest(url=url, id=youtube_id):
+ slide = Slide.create({
+ 'name': 'dummy',
+ 'channel_id': self.channel.id,
+ 'url': url,
+ 'slide_category': 'video'
+ })
+ self.assertEqual('youtube', slide.video_source_type)
+ self.assertEqual(youtube_id, slide.youtube_id)
+
+ # test URL from Google Drive when user hits the "share" button (main use case)
+ slide = Slide.create({
+ 'name': 'dummy',
+ 'channel_id': self.channel.id,
+ 'url': 'https://drive.google.com/file/d/1qU5nHVNbz_r84P_IS5kDzoCuC1h5ZAZR/view?usp=sharing',
+ 'slide_category': 'video'
+ })
+ self.assertEqual('google_drive', slide.video_source_type)
+ self.assertEqual('1qU5nHVNbz_r84P_IS5kDzoCuC1h5ZAZR', slide.google_drive_id)
diff --git a/addons/website_slides/tests/test_statistics.py b/addons/website_slides/tests/test_statistics.py
index 9ca1ffb1424..a570530ee84 100644
--- a/addons/website_slides/tests/test_statistics.py
+++ b/addons/website_slides/tests/test_statistics.py
@@ -42,7 +42,6 @@ class TestChannelStatistics(common.SlidesCase):
# slide category computation
self.assertEqual(channel_publisher.total_slides, len(channel_publisher.slide_content_ids))
self.assertEqual(channel_publisher.nbr_infographic, len(channel_publisher.slide_content_ids.filtered(lambda s: s.slide_category == 'infographic')))
- self.assertEqual(channel_publisher.nbr_presentation, len(channel_publisher.slide_content_ids.filtered(lambda s: s.slide_category == 'presentation')))
self.assertEqual(channel_publisher.nbr_document, len(channel_publisher.slide_content_ids.filtered(lambda s: s.slide_category == 'document')))
self.assertEqual(channel_publisher.nbr_video, len(channel_publisher.slide_content_ids.filtered(lambda s: s.slide_category == 'video')))
# slide statistics computation
@@ -158,9 +157,6 @@ class TestSlideStatistics(common.SlidesCase):
@users('user_officer')
def test_slide_statistics_categories(self):
category = self.category.with_user(self.env.user)
- self.assertEqual(
- category.nbr_presentation,
- len(category.channel_id.slide_ids.filtered(lambda s: s.category_id == category and s.slide_category == 'presentation')))
self.assertEqual(
category.nbr_document,
len(category.channel_id.slide_ids.filtered(lambda s: s.category_id == category and s.slide_category == 'document')))
diff --git a/addons/website_slides/tests/test_ui_wslides.py b/addons/website_slides/tests/test_ui_wslides.py
index e2610ed8242..bc5fa4bf21f 100644
--- a/addons/website_slides/tests/test_ui_wslides.py
+++ b/addons/website_slides/tests/test_ui_wslides.py
@@ -34,7 +34,7 @@ class TestUICommon(HttpCaseWithUserDemo, HttpCaseWithUserPortal):
'name': 'Gardening: The Know-How',
'sequence': 1,
'binary_content': pdf_content,
- 'slide_category': 'presentation',
+ 'slide_category': 'document',
'is_published': True,
'is_preview': True,
}), (0, 0, {
diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml
index 48d0c6cd78e..cf776939d11 100644
--- a/addons/website_slides/views/slide_slide_views.xml
+++ b/addons/website_slides/views/slide_slide_views.xml
@@ -117,13 +117,32 @@
-
-
-
-
+
+
+
+
+
+
+
@@ -133,7 +152,7 @@
hours