From a27bc32c632961efd10a41c63ccebc0f4cc9f3a0 Mon Sep 17 00:00:00 2001 From: tunny17 Date: Mon, 7 Aug 2023 19:44:26 +0000 Subject: [PATCH] CLASSROOMIO-T-30:Developed the UI for the video upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLASSROOMIO-T-30: UI cleanup CLASSROOMIO-T-30: Improve UX Merge branch 'CLASSROOMIO-T-30' of https://gitlab.com/thenextgreat/classroomio into CLASSROOMIO-T-30 CLASSROOMIO-T-30:Made the input clear after upload and also chnged the icons CLASSROOMIO-T-30: Remove console log CLASSROOMIO-T-30: Better trim out white spaces in url CLASSROOMIO-T-30:Fixed the bug between the save and edit CLASSROOMIO-T-30:Trying to fix the bug between edit and save Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio CLASSROOMIO-T-30:Stil working on the reviews CLASSROOMIO-T-30:Still working on some of the reviews and updates CLASSROOMIO-T-30: Remove unnessecary values in store CLASSROOMIO-T-30: Change button to div in modal CLASSROOMIO-T-100: Select only courses belonging to current org and current user is a member CLASSROOMIO-T-100: Update condition for fetchCourses CLASSROOMIO-T-100: Select only courses belonging to current org and current user is a member Co-authored-by: Rotimi Best Merge-request: CLASSROOMIO-MR-35 Merged-by: Best Admin Remove netlify app from redirect rule Add redirect to layout's load Redirect to about domain CLASSROOMIO-T-97: UX again? 😇 CLASSROOMIO-T-97: Better course UX 😍😍 CLASSROOMIO-T-97: Better button style and fix route not found CLASSROOMIO-T-97: Course UI improvement 😁😁😁 CLASSROOMIO-T-30: Add plyr CLASSROOMIO-T-30:Merged main into branch Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio CLASSROOMIO-T-30:Wotking on the lms dashboard CLASSROOMIO-T-30:Made some changes based on the reviews Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio CLASSROOMIO-T-30:Made some refactoring to keep the code DRY CLASSROOMIO-T-30:Developed the UI for the video upload Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio Merge branch 'main' of https://gitlab.com/thenextgreat/classroomio CLASSROOMIO-T-27: Review Section for Instructors on landing page CLASSROOMIO-T-27: Remove unused variable Merge branch 'CLASSROOMIO-T-27' of https://gitlab.com/thenextgreat/classroomio into CLASSROOMIO-T-27 CLASSROOMIO-T-27: Complete reviews functionality CLASSROOMIO-T-27: Review Render Update CLASSROOMIO-T-27: - Resolved Feedbacks CLASSROOMIO-T-27: Fixed Ratings Data CLASSROOMIO-T-27: - Added Ratings Svg - Fixed avatar_url feedback CLASSROOMIO-T-27: Import Adjustment CLASSROOMIO-T-27: Code Review CLASSROOM-T-27: Added Add Review Functionality CLASSROOMIO-T-27: - Unresolved Review - Enhance Code Redability CLASSROOMIO-T-27: Completed the delete functionality CLASSROOMIO-T-27: Hide/Show functionality CLASSROOMIO-T-27: Double Quotation Update CLASSROOMIO-T-27: Testing toggle functinality CLASSROOMIO-T-27: Added the icons CLASSROOMIO-T-27: Completion of the hide/show functionality CLASSROOMIO-T-27: Display the store data on the review page for styling CLASSROOMIO-T-27: Styling of the review component & connecting it's data CLASSROOMIO-T-27: - Add ReviewsForm - Completion of the Reviews Form Structure/Styling CLASSROOMIO-T-27: Added a reviews modal CLASSROOMIO-T-27: Logic update for review section CLASSROOMIO-T-50: Logic for overlapping reviews CLASSROOMIO-T-27: - Completion of the structure & styling with mock data. - Addition of custom ratings assets CLASSROOMIO-T-27: - Review Section Code Structure - Import Profile Picture Assets Co-authored-by: Rotimi Best Co-authored-by: Tunji Adeyemi Co-authored-by: tunny17 Merge-request: CLASSROOMIO-MR-22 Merged-by: Best Admin CLASSROOMIO-T-62: Dark Mode Bug Fix CLASSROOMIO-T-62: Delete Unused class CLASSROOMIO-T-62: Dark Mode Bug Fix Co-authored-by: Tunji Adeyemi Merge-request: CLASSROOMIO-MR-23 Merged-by: Best Admin Co-authored-by: Ifeanyi Nwosu Co-authored-by: Rotimi Best Co-authored-by: Tunji Adeyemi Co-authored-by: tunny17 Merge-request: CLASSROOMIO-MR-33 Merged-by: Best Admin --- src/lib/components/Buttons/Close/index.svelte | 5 +- .../Lesson/Materials/Video/Index.svelte | 40 ++++++ .../Lesson/Materials/Video/LocalVideo.svelte | 88 ++++++++++++ .../Materials/Video/YoutubeVideo.svelte | 79 +++++++++++ .../Lesson/Materials/Video/constants.js | 14 ++ .../components/Lesson/Materials/index.svelte | 131 +++++++++++++----- .../Course/components/Lesson/store/lessons.ts | 27 +++- .../Course/components/Navigation/index.svelte | 3 +- src/lib/components/Icons/CommunityIcon.svelte | 12 ++ src/lib/components/Icons/CourseIcon.svelte | 4 +- src/lib/components/Icons/ExerciseIcon.svelte | 14 +- src/lib/components/Icons/HomeIcon.svelte | 6 +- src/lib/components/Icons/ReviewsIcon.svelte | 20 +++ src/lib/components/LMS/SideBar.svelte | 79 ++++++----- src/lib/components/Modal/index.svelte | 14 +- src/routes/course/[slug]/+page.svelte | 2 + .../courses/[id]/certificates/+page.svelte | 3 +- .../courses/[id]/landingpage/+page.svelte | 3 +- .../lessons/[...lessonParams]/+page.svelte | 15 +- src/routes/lms/+page.svelte | 16 ++- src/routes/lms/community/+page.svelte | 1 + src/routes/lms/reviews/+page.svelte | 1 + static/course-video.png | Bin 0 -> 19603 bytes static/delete-video.svg | 3 + static/no-video.svg | 4 + static/upload-video.svg | 4 + static/video-upload-error.svg | 6 + 27 files changed, 495 insertions(+), 99 deletions(-) create mode 100644 src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte create mode 100644 src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte create mode 100644 src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte create mode 100644 src/lib/components/Course/components/Lesson/Materials/Video/constants.js create mode 100644 src/lib/components/Icons/CommunityIcon.svelte create mode 100644 src/lib/components/Icons/ReviewsIcon.svelte create mode 100644 src/routes/lms/community/+page.svelte create mode 100644 src/routes/lms/reviews/+page.svelte create mode 100644 static/course-video.png create mode 100644 static/delete-video.svg create mode 100644 static/no-video.svg create mode 100644 static/upload-video.svg create mode 100644 static/video-upload-error.svg diff --git a/src/lib/components/Buttons/Close/index.svelte b/src/lib/components/Buttons/Close/index.svelte index 204e6c63..7a81c895 100644 --- a/src/lib/components/Buttons/Close/index.svelte +++ b/src/lib/components/Buttons/Close/index.svelte @@ -4,7 +4,7 @@ export let onClick; export let contained; - export let color = ''; + export let color = 'text-blue-700 bg-blue-200 dark:bg-gray-500'; export let size = 'large'; @@ -12,6 +12,7 @@ {#if size === 'large'} {:else} - + {/if} + diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte new file mode 100644 index 00000000..745b81ed --- /dev/null +++ b/src/lib/components/Course/components/Lesson/Materials/Video/Index.svelte @@ -0,0 +1,40 @@ + + +
+
+

Add By

+ {#each tabs as item (item.value)} + + {/each} +
+
+ {#if currentTab === 1} + + {:else} + + {/if} +
+
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte new file mode 100644 index 00000000..ce254b0b --- /dev/null +++ b/src/lib/components/Course/components/Lesson/Materials/Video/LocalVideo.svelte @@ -0,0 +1,88 @@ + + +{#if isLoaded == false} + +{:else if isBig && isUploaded == false} +
+ upload error + +

+ Oops 😬, couldn’t upload video +

+

+ Sorry we video wasn’t uploaded. The file size is too big,
maximum size is 20 MB. Try again! +

+
+ +
+{:else if isWrongFormat && isUploaded == false} +
+ upload error + +

+ Oops 😬, couldn’t upload video +

+

+ Sorry we video wasn’t uploaded, the file format isn’t supported.
Upload MP4, MOV and AVI + files. +

+
+ +
+{:else} +
+
+
+ +
+ coursevideo +
+

Video.png

+
+ +
+
+
+ +
+
+{/if} diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte b/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte new file mode 100644 index 00000000..587f83e9 --- /dev/null +++ b/src/lib/components/Course/components/Lesson/Materials/Video/YoutubeVideo.svelte @@ -0,0 +1,79 @@ + + +
+ ($isLessonDirty = true)} + placeholder="https://www.youtube.com/watch?v=" + errorMessage={error} + /> + +
+

+ Added : {($lesson?.materials?.video_url && $lesson.materials.video_url.trim().split(',').length) || 0} Videos +

+
+ {#each $lesson?.materials?.video_url && $lesson.materials.video_url + .trim() + .split(',') as videoLink, index} +
+ + {videoLink} + + + removeVideo(index)}> + + +
+ {/each} +
diff --git a/src/lib/components/Course/components/Lesson/Materials/Video/constants.js b/src/lib/components/Course/components/Lesson/Materials/Video/constants.js new file mode 100644 index 00000000..bfe0e734 --- /dev/null +++ b/src/lib/components/Course/components/Lesson/Materials/Video/constants.js @@ -0,0 +1,14 @@ +import Link from 'carbon-icons-svelte/lib/Link.svelte'; +import Video from 'carbon-icons-svelte/lib/Video.svelte'; +export const videoTabs = [ + { + value: 1, + title: 'Youtube Link', + icon: Link + }, + { + value: 2, + title: 'Video', + icon: Video + } +]; diff --git a/src/lib/components/Course/components/Lesson/Materials/index.svelte b/src/lib/components/Course/components/Lesson/Materials/index.svelte index 5b78221d..a9f22bf7 100644 --- a/src/lib/components/Course/components/Lesson/Materials/index.svelte +++ b/src/lib/components/Course/components/Lesson/Materials/index.svelte @@ -1,11 +1,13 @@ - + + + + @@ -186,37 +236,48 @@ - {#if mode === MODES.edit} - ($isLessonDirty = true)} - /> - {:else if !!$lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')} - {#each $lesson.materials.video_url.split(',') as url} -
-