From 1f23f0692668154f3337c5502024fbd30acd0d63 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 21 Apr 2025 15:41:51 +0530 Subject: [PATCH 01/10] fix: allow fullscreen on vimeo and adjust video height on mobile devices --- frontend/src/utils/index.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index b3f87c97..7339f3dd 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -201,9 +201,9 @@ export function getEditorTools() { regex: /(?:https?:\/\/)?(?:www\.)?(?:(?:youtu\.be\/)|(?:youtube\.com)\/(?:v\/|u\/\w\/|embed\/|watch))(?:(?:\?v=)?([^#&?=]*))?((?:[?&]\w*=\w*)*)/, embedUrl: 'https://www.youtube.com/embed/<%= remote_id %>', - html: '', - height: 320, - width: 580, + html: ``, id: ([id, params]) => { if (!params && id) { return id @@ -249,28 +249,40 @@ export function getEditorTools() { return id + '?' + newParams.join('&') }, }, - vimeo: true, + vimeo: { + regex: /(?:http[s]?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/, + embedUrl: + 'https://player.vimeo.com/video/<%= remote_id %>', + html: ``, + id: ([id]) => id, + }, codepen: true, aparat: { regex: /(?:http[s]?:\/\/)?(?:www.)?aparat\.com\/v\/([^\/\?\&]+)\/?/, embedUrl: 'https://www.aparat.com/video/video/embed/videohash/<%= remote_id %>/vt/frame', - html: '', - height: 300, - width: 600, + html: ``, }, github: true, slides: { regex: /https:\/\/docs\.google\.com\/presentation\/d\/([A-Za-z0-9_-]+)\/pub/, embedUrl: 'https://docs.google.com/presentation/d/<%= remote_id %>/embed', - html: "", + html: ``, }, drive: { regex: /https:\/\/drive\.google\.com\/file\/d\/([A-Za-z0-9_-]+)\/view(\?.+)?/, embedUrl: 'https://drive.google.com/file/d/<%= remote_id %>/preview', - html: "", + html: ``, }, docsPublic: { regex: /https:\/\/docs\.google\.com\/document\/d\/([A-Za-z0-9_-]+)\/edit(\?.+)?/, From 6c50292a6603983d03f3d22b25db9602dd3c0b5b Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 21 Apr 2025 16:16:54 +0530 Subject: [PATCH 02/10] fix: tags spacing on course cards --- frontend/src/components/CourseCard.vue | 14 +++++++++----- frontend/src/pages/CourseDetail.vue | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/CourseCard.vue b/frontend/src/components/CourseCard.vue index d26f5130..98093808 100644 --- a/frontend/src/components/CourseCard.vue +++ b/frontend/src/components/CourseCard.vue @@ -9,16 +9,20 @@ :class="{ 'default-image': !course.image }" :style="{ backgroundImage: 'url(\'' + encodeURI(course.image) + '\')' }" > -
- +
+ {{ __('Featured') }}
{{ tag }}
diff --git a/frontend/src/pages/CourseDetail.vue b/frontend/src/pages/CourseDetail.vue index 561c9362..eaa9d7ac 100644 --- a/frontend/src/pages/CourseDetail.vue +++ b/frontend/src/pages/CourseDetail.vue @@ -56,7 +56,7 @@
-
+
Date: Tue, 22 Apr 2025 12:52:49 +0530 Subject: [PATCH 03/10] chore: Serbian (Latin) translations --- lms/locale/sr_CS.po | 210 ++++++++++++++++++++++---------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/lms/locale/sr_CS.po b/lms/locale/sr_CS.po index f7e12300..cc8c2e13 100644 --- a/lms/locale/sr_CS.po +++ b/lms/locale/sr_CS.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: frappe\n" "Report-Msgid-Bugs-To: jannat@frappe.io\n" "POT-Creation-Date: 2025-04-18 16:04+0000\n" -"PO-Revision-Date: 2025-04-21 06:39\n" +"PO-Revision-Date: 2025-04-22 07:22\n" "Last-Translator: jannat@frappe.io\n" "Language-Team: Serbian (Latin)\n" "MIME-Version: 1.0\n" @@ -105,7 +105,7 @@ msgstr "" #. Option for the 'Status' (Select) field in DocType 'LMS Batch Old' #: lms/lms/doctype/lms_batch_old/lms_batch_old.json msgid "Active" -msgstr "" +msgstr "Aktivan" #: frontend/src/components/Assessments.vue:11 #: frontend/src/components/BatchCourses.vue:11 @@ -116,7 +116,7 @@ msgstr "" #: frontend/src/components/Members.vue:43 frontend/src/pages/ProgramForm.vue:30 #: frontend/src/pages/ProgramForm.vue:92 frontend/src/pages/ProgramForm.vue:137 msgid "Add" -msgstr "" +msgstr "Dodaj" #: frontend/src/components/CourseOutline.vue:18 #: frontend/src/components/CreateOutline.vue:18 @@ -213,15 +213,15 @@ msgstr "" #: frontend/src/pages/Billing.vue:64 #: lms/lms/doctype/lms_payment/lms_payment.json msgid "Address" -msgstr "" +msgstr "Adresa" #: frontend/src/pages/Billing.vue:74 msgid "Address Line 1" -msgstr "" +msgstr "Adresa, red 1" #: frontend/src/pages/Billing.vue:78 msgid "Address Line 2" -msgstr "" +msgstr "Adresa, red 2" #. Option for the 'Role' (Select) field in DocType 'Cohort Staff' #. Option for the 'Required Role' (Select) field in DocType 'Cohort Web Page' @@ -235,7 +235,7 @@ msgstr "" #. Name of a role #: frontend/src/pages/Batches.vue:284 lms/lms/doctype/lms_badge/lms_badge.json msgid "All" -msgstr "" +msgstr "Sve" #: frontend/src/pages/Batches.vue:26 msgid "All Batches" @@ -294,7 +294,7 @@ msgstr "" #: lms/lms/doctype/lms_payment/lms_payment.json #: lms/public/js/common_functions.js:379 msgid "Amount" -msgstr "" +msgstr "Iznos" #. Label of the amount_usd (Currency) field in DocType 'LMS Batch' #. Label of the amount_usd (Currency) field in DocType 'LMS Course' @@ -445,7 +445,7 @@ msgstr "" #: lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json #: lms/templates/assignment.html:3 msgid "Assignment" -msgstr "" +msgstr "Zadatak" #. Label of the assignment_attachment (Attach) field in DocType 'LMS Assignment #. Submission' @@ -550,7 +550,7 @@ msgstr "" #: lms/lms/doctype/lms_certificate_request/lms_certificate_request.json #: lms/lms/doctype/lms_live_class/lms_live_class.json msgid "Batch" -msgstr "" +msgstr "Šarža" #. Label of the batch_confirmation_template (Link) field in DocType 'LMS #. Settings' @@ -571,7 +571,7 @@ msgstr "" #. Old' #: lms/lms/doctype/lms_batch_old/lms_batch_old.json msgid "Batch Description" -msgstr "" +msgstr "Opis šarže" #. Label of the batch_details (Text Editor) field in DocType 'LMS Batch' #: frontend/src/pages/BatchForm.vue:250 @@ -579,7 +579,7 @@ msgstr "" #: lms/public/js/common_functions.js:349 #: lms/templates/emails/batch_confirmation.html:24 msgid "Batch Details" -msgstr "" +msgstr "Detalji šarže" #. Label of the batch_details_raw (HTML Editor) field in DocType 'LMS Batch' #: lms/lms/doctype/lms_batch/lms_batch.json @@ -669,7 +669,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:8 frontend/src/pages/Billing.vue:363 #: lms/lms/doctype/lms_payment/lms_payment.json msgid "Billing Details" -msgstr "" +msgstr "Detalji fakturisanja" #. Label of the billing_name (Data) field in DocType 'LMS Payment' #: frontend/src/pages/Billing.vue:70 @@ -694,7 +694,7 @@ msgstr "" #. Label of the branch (Data) field in DocType 'User' #: lms/fixtures/custom_field.json msgid "Branch" -msgstr "" +msgstr "Filijala" #. Option for the 'User Category' (Select) field in DocType 'User' #: lms/fixtures/custom_field.json lms/templates/signup-form.html:23 @@ -730,7 +730,7 @@ msgstr "" #: lms/lms/doctype/lms_batch_old/lms_batch_old.json #: lms/lms/doctype/lms_certificate_request/lms_certificate_request.json msgid "Cancelled" -msgstr "" +msgstr "Otkazano" #. Label of the carrer_preference_details (Section Break) field in DocType #. 'User' @@ -766,7 +766,7 @@ msgstr "" #: lms/lms/doctype/lms_enrollment/lms_enrollment.json #: lms/lms/workspace/lms/lms.json msgid "Certificate" -msgstr "" +msgstr "Sertifikat" #. Label of the certification_template (Link) field in DocType 'LMS Settings' #: lms/lms/doctype/lms_settings/lms_settings.json @@ -911,7 +911,7 @@ msgstr "" #. Label of the city (Data) field in DocType 'User' #: frontend/src/pages/Billing.vue:81 lms/fixtures/custom_field.json msgid "City" -msgstr "" +msgstr "Grad" #: lms/templates/emails/live_class_reminder.html:10 msgid "Class:" @@ -945,7 +945,7 @@ msgstr "" #: lms/job/doctype/job_opportunity/job_opportunity.json #: lms/lms/doctype/lms_batch_old/lms_batch_old.json msgid "Closed" -msgstr "" +msgstr "Zatvoreno" #. Option for the 'Auto Recording' (Select) field in DocType 'LMS Live Class' #: lms/lms/doctype/lms_live_class/lms_live_class.json @@ -1034,7 +1034,7 @@ msgstr "" #: lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json #: lms/lms/doctype/lms_mentor_request/lms_mentor_request.json msgid "Comments" -msgstr "" +msgstr "Komentari" #: frontend/src/components/Assignment.vue:142 msgid "Comments by Evaluator" @@ -1045,7 +1045,7 @@ msgstr "" #: lms/job/doctype/lms_job_application/lms_job_application.json #: lms/lms/doctype/work_experience/work_experience.json msgid "Company" -msgstr "" +msgstr "Kompanija" #. Label of the company_details_section (Section Break) field in DocType 'Job #. Opportunity' @@ -1064,13 +1064,13 @@ msgstr "" #: frontend/src/pages/JobCreation.vue:88 #: lms/job/doctype/job_opportunity/job_opportunity.json msgid "Company Logo" -msgstr "" +msgstr "Logo kompanije" #. Label of the company_name (Data) field in DocType 'Job Opportunity' #: frontend/src/pages/JobCreation.vue:70 #: lms/job/doctype/job_opportunity/job_opportunity.json msgid "Company Name" -msgstr "" +msgstr "Naziv kompanije" #. Label of the company_type (Select) field in DocType 'User' #: lms/fixtures/custom_field.json @@ -1088,7 +1088,7 @@ msgstr "" #: lms/lms/doctype/lms_course_progress/lms_course_progress.json #: lms/lms/widgets/CourseCard.html:75 lms/templates/reviews.html:48 msgid "Complete" -msgstr "" +msgstr "Završeno" #: lms/templates/emails/lms_invite_request_approved.html:7 msgid "Complete Sign Up" @@ -1110,7 +1110,7 @@ msgstr "" #: lms/lms/doctype/lms_certificate_request/lms_certificate_request.json #: lms/lms/widgets/CourseCard.html:78 msgid "Completed" -msgstr "" +msgstr "Završeno" #: frontend/src/components/BatchStudents.vue:370 msgid "Completed by Students" @@ -1182,7 +1182,7 @@ msgstr "" #: frontend/src/pages/Jobs.vue:163 #: lms/job/doctype/job_opportunity/job_opportunity.json msgid "Contract" -msgstr "" +msgstr "Ugovor" #: lms/lms/utils.py:436 msgid "Cookie Policy" @@ -1215,7 +1215,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:92 lms/fixtures/custom_field.json #: lms/lms/doctype/payment_country/payment_country.json msgid "Country" -msgstr "" +msgstr "Država" #. Label of the course (Link) field in DocType 'Batch Course' #. Label of the course (Link) field in DocType 'Cohort' @@ -1426,7 +1426,7 @@ msgstr "" #: frontend/src/components/Modals/ChapterModal.vue:9 #: frontend/src/pages/Programs.vue:108 msgid "Create" -msgstr "" +msgstr "Kreiraj" #: lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.js:7 msgid "Create Certificate" @@ -1493,7 +1493,7 @@ msgstr "" #: lms/lms/doctype/lms_payment/lms_payment.json #: lms/public/js/common_functions.js:387 msgid "Currency" -msgstr "" +msgstr "Valuta" #. Label of the current_lesson (Link) field in DocType 'LMS Enrollment' #: lms/lms/doctype/lms_enrollment/lms_enrollment.json @@ -1528,7 +1528,7 @@ msgstr "" #. Label of the show_dashboard (Check) field in DocType 'LMS Settings' #: lms/lms/doctype/lms_settings/lms_settings.json msgid "Dashboard" -msgstr "" +msgstr "Kontrolna tabla" #. Label of the date (Date) field in DocType 'LMS Batch Timetable' #. Label of the date (Date) field in DocType 'LMS Certificate Evaluation' @@ -1545,7 +1545,7 @@ msgstr "" #: lms/lms/doctype/scheduled_flow/scheduled_flow.json #: lms/templates/quiz/quiz.html:149 msgid "Date" -msgstr "" +msgstr "Datum" #. Label of the section_break_glxh (Section Break) field in DocType 'LMS Live #. Class' @@ -1571,7 +1571,7 @@ msgstr "" #: lms/templates/emails/mentor_request_creation_email.html:2 #: lms/templates/emails/mentor_request_status_update_email.html:2 msgid "Dear" -msgstr "" +msgstr "Poštovani/na" #: lms/templates/emails/batch_confirmation.html:2 #: lms/templates/emails/batch_start_reminder.html:2 @@ -1583,7 +1583,7 @@ msgstr "" #. Label of the default_currency (Link) field in DocType 'LMS Settings' #: lms/lms/doctype/lms_settings/lms_settings.json msgid "Default Currency" -msgstr "" +msgstr "Podrazumevana valuta" #. Label of the degree_type (Data) field in DocType 'Education Detail' #: lms/lms/doctype/education_detail/education_detail.json @@ -1594,7 +1594,7 @@ msgstr "" #: frontend/src/components/CourseOutline.vue:306 #: frontend/src/pages/CourseForm.vue:483 msgid "Delete" -msgstr "" +msgstr "Obriši" #: frontend/src/components/CourseOutline.vue:59 msgid "Delete Chapter" @@ -1651,7 +1651,7 @@ msgstr "" #: lms/lms/doctype/work_experience/work_experience.json #: lms/public/js/common_functions.js:342 msgid "Description" -msgstr "" +msgstr "Opis" #: frontend/src/components/Apps.vue:51 msgid "Desk" @@ -1680,7 +1680,7 @@ msgstr "" #. Label of the disabled (Check) field in DocType 'Job Opportunity' #: lms/job/doctype/job_opportunity/job_opportunity.json msgid "Disabled" -msgstr "" +msgstr "Onemogućeno" #: frontend/src/components/DiscussionReplies.vue:55 #: lms/lms/widgets/NoPreviewModal.html:25 lms/templates/reviews.html:159 @@ -1723,7 +1723,7 @@ msgstr "" #: lms/lms/doctype/lms_batch_timetable/lms_batch_timetable.json #: lms/lms/doctype/lms_live_class/lms_live_class.json msgid "Duration" -msgstr "" +msgstr "Trajanje" #. Label of the duration (Data) field in DocType 'LMS Quiz' #: frontend/src/pages/QuizForm.vue:63 lms/lms/doctype/lms_quiz/lms_quiz.json @@ -1750,7 +1750,7 @@ msgstr "" #: frontend/src/pages/JobDetail.vue:31 frontend/src/pages/Lesson.vue:66 #: frontend/src/pages/Profile.vue:32 frontend/src/pages/Programs.vue:53 msgid "Edit" -msgstr "" +msgstr "Izmeni" #: frontend/src/components/Modals/AssignmentForm.vue:8 msgid "Edit Assignment" @@ -1772,7 +1772,7 @@ msgstr "" #. Label of the education (Table) field in DocType 'User' #: lms/fixtures/custom_field.json msgid "Education" -msgstr "" +msgstr "Obrazovanje" #. Name of a DocType #: lms/lms/doctype/education_detail/education_detail.json @@ -1787,7 +1787,7 @@ msgstr "" #: frontend/src/components/Evaluators.vue:32 #: frontend/src/components/Members.vue:32 lms/templates/signup-form.html:10 msgid "Email" -msgstr "" +msgstr "Imejl" #: frontend/src/components/Modals/Event.vue:16 msgid "Email ID" @@ -1815,7 +1815,7 @@ msgstr "" #. Option for the 'User Category' (Select) field in DocType 'User' #: lms/fixtures/custom_field.json lms/templates/signup-form.html:25 msgid "Employee" -msgstr "" +msgstr "Zaposleno lice" #. Label of the enable (Check) field in DocType 'Zoom Settings' #: lms/lms/doctype/zoom_settings/zoom_settings.json @@ -1850,7 +1850,7 @@ msgstr "" #: lms/lms/doctype/lms_batch/lms_batch.json #: lms/public/js/common_functions.js:282 msgid "End Date" -msgstr "" +msgstr "Datum završetka" #. Label of the end_date (Date) field in DocType 'Education Detail' #: lms/lms/doctype/education_detail/education_detail.json @@ -1948,7 +1948,7 @@ msgstr "" #: frontend/src/pages/QuizForm.vue:364 #: frontend/src/pages/QuizSubmission.vue:150 msgid "Error" -msgstr "" +msgstr "Greška" #: lms/lms/doctype/lms_batch/lms_batch.py:185 msgid "Error creating live class. Please try again. {0}" @@ -2085,7 +2085,7 @@ msgstr "" #: frontend/src/components/Modals/Event.vue:126 #: lms/lms/doctype/lms_certificate/lms_certificate.json msgid "Expiry Date" -msgstr "" +msgstr "Datum isteka" #. Label of the explanation_1 (Small Text) field in DocType 'LMS Question' #. Label of the explanation_3 (Small Text) field in DocType 'LMS Question' @@ -2126,7 +2126,7 @@ msgstr "" #: frontend/src/components/BatchFeedback.vue:29 #: lms/lms/doctype/lms_batch_feedback/lms_batch_feedback.json msgid "Feedback" -msgstr "" +msgstr "Povratna informacija" #: frontend/src/components/Assignment.vue:64 msgid "Feel free to make edits to your submission if needed." @@ -2202,12 +2202,12 @@ msgstr "" #: frontend/src/pages/ProfileEvaluator.vue:85 #: lms/lms/doctype/course_evaluator/course_evaluator.json msgid "From" -msgstr "" +msgstr "Od" #. Label of the from_date (Date) field in DocType 'Work Experience' #: lms/lms/doctype/work_experience/work_experience.json msgid "From Date" -msgstr "" +msgstr "Datum početka" #. Label of the full_name (Data) field in DocType 'Course Evaluator' #. Label of the full_name (Data) field in DocType 'Invite Request' @@ -2326,7 +2326,7 @@ msgstr "" #: frontend/src/components/AppSidebar.vue:98 msgid "Help" -msgstr "" +msgstr "Pomoć" #: frontend/src/components/BatchFeedback.vue:11 msgid "Help Us Improve" @@ -2359,7 +2359,7 @@ msgstr "" #: lms/templates/emails/lms_invite_request_approved.html:3 msgid "Hi," -msgstr "" +msgstr "Zdravo," #. Label of the hide_private (Check) field in DocType 'User' #: lms/fixtures/custom_field.json @@ -2400,7 +2400,7 @@ msgstr "" #: frontend/src/pages/QuizForm.vue:383 msgid "ID" -msgstr "" +msgstr "ID" #. Label of the icon (Data) field in DocType 'LMS Sidebar Item' #: frontend/src/components/Modals/PageModal.vue:28 @@ -2482,7 +2482,7 @@ msgstr "" #: lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json #: lms/lms/doctype/lms_course/lms_course.json msgid "In Progress" -msgstr "" +msgstr "U toku" #. Option for the 'Status' (Select) field in DocType 'LMS Batch Old' #: lms/lms/doctype/lms_batch_old/lms_batch_old.json @@ -2529,7 +2529,7 @@ msgstr "" #: lms/lms/doctype/industry/industry.json #: lms/lms/doctype/preferred_industry/preferred_industry.json msgid "Industry" -msgstr "" +msgstr "Industrija" #. Label of the institution_name (Data) field in DocType 'Education Detail' #: lms/lms/doctype/education_detail/education_detail.json @@ -2643,7 +2643,7 @@ msgstr "" #: lms/lms/doctype/certification/certification.json #: lms/lms/doctype/lms_certificate/lms_certificate.json msgid "Issue Date" -msgstr "" +msgstr "Datum izdavanja" #: frontend/src/components/AppSidebar.vue:549 msgid "Issue a Certificate" @@ -3100,7 +3100,7 @@ msgstr "" #. Option for the 'Auto Recording' (Select) field in DocType 'LMS Live Class' #: lms/lms/doctype/lms_live_class/lms_live_class.json msgid "Local" -msgstr "" +msgstr "Lokalno" #. Label of the location (Data) field in DocType 'Job Opportunity' #. Label of the location (Data) field in DocType 'Education Detail' @@ -3110,7 +3110,7 @@ msgstr "" #: lms/lms/doctype/education_detail/education_detail.json #: lms/lms/doctype/work_experience/work_experience.json msgid "Location" -msgstr "" +msgstr "Lokacija" #. Label of the location_preference (Select) field in DocType 'User' #: lms/fixtures/custom_field.json @@ -3156,7 +3156,7 @@ msgstr "" #. Option for the 'Role' (Select) field in DocType 'Cohort Staff' #: lms/lms/doctype/cohort_staff/cohort_staff.json msgid "Manager" -msgstr "" +msgstr "Menadžer" #. Option for the 'User Category' (Select) field in DocType 'User' #: lms/fixtures/custom_field.json lms/templates/signup-form.html:24 @@ -3216,7 +3216,7 @@ msgstr "" #: lms/lms/doctype/lms_batch/lms_batch.json #: lms/public/js/common_functions.js:309 msgid "Medium" -msgstr "" +msgstr "Srednje" #. Label of the medium (Data) field in DocType 'User' #: lms/fixtures/custom_field.json @@ -3438,7 +3438,7 @@ msgstr "" #: lms/lms/doctype/lms_badge/lms_badge.js:40 msgid "Modified By" -msgstr "" +msgstr "Izmenjeno od strane" #: lms/lms/api.py:218 msgid "Module Name is incorrect or does not exist." @@ -3481,7 +3481,7 @@ msgstr "" #: frontend/src/pages/Courses.vue:17 frontend/src/pages/Courses.vue:284 #: frontend/src/pages/Programs.vue:14 lms/lms/doctype/lms_badge/lms_badge.json msgid "New" -msgstr "" +msgstr "Novi" #: lms/public/js/common_functions.js:255 lms/www/lms.py:139 msgid "New Batch" @@ -3539,7 +3539,7 @@ msgstr "" #: frontend/src/components/Quiz.vue:213 frontend/src/pages/Lesson.vue:85 msgid "Next" -msgstr "" +msgstr "Sledeće" #: lms/templates/quiz/quiz.html:125 msgid "Next Question" @@ -3653,17 +3653,17 @@ msgstr "" #: lms/templates/quiz/quiz.html:147 msgid "No." -msgstr "" +msgstr "Br." #: lms/lms/user.py:29 msgid "Not Allowed" -msgstr "" +msgstr "Nije dozvoljeno" #. Option for the 'Status' (Select) field in DocType 'LMS Assignment #. Submission' #: lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.json msgid "Not Applicable" -msgstr "" +msgstr "Nije primenljivo" #: lms/templates/assessments.html:48 msgid "Not Attempted" @@ -3681,7 +3681,7 @@ msgstr "" #: frontend/src/components/NoPermission.vue:7 frontend/src/pages/Batch.vue:156 msgid "Not Permitted" -msgstr "" +msgstr "Nije dozvoljeno" #: frontend/src/components/Assignment.vue:36 #: frontend/src/components/BrandSettings.vue:10 @@ -3758,7 +3758,7 @@ msgstr "" #: lms/job/doctype/job_opportunity/job_opportunity.json #: lms/lms/doctype/lms_batch_old/lms_batch_old.json msgid "Open" -msgstr "" +msgstr "Otvoreno" #: lms/templates/emails/assignment_submission.html:8 msgid "Open Assignment" @@ -3813,7 +3813,7 @@ msgstr "" #. Label of the organization (Data) field in DocType 'Certification' #: lms/lms/doctype/certification/certification.json msgid "Organization" -msgstr "" +msgstr "Organizacija" #: frontend/src/pages/Billing.vue:32 msgid "Original Amount" @@ -3826,7 +3826,7 @@ msgstr "" #: lms/lms/doctype/lms_badge/lms_badge.js:39 msgid "Owner" -msgstr "" +msgstr "Vlasnik" #. Label of the pan (Data) field in DocType 'LMS Payment' #: lms/lms/doctype/lms_payment/lms_payment.json @@ -3918,7 +3918,7 @@ msgstr "" #: lms/lms/doctype/lms_batch_enrollment/lms_batch_enrollment.json #: lms/lms/doctype/lms_enrollment/lms_enrollment.json msgid "Payment" -msgstr "" +msgstr "Plaćanje" #. Name of a DocType #: lms/lms/doctype/payment_country/payment_country.json @@ -3934,7 +3934,7 @@ msgstr "" #. Label of the payment_gateway (Data) field in DocType 'LMS Settings' #: lms/lms/doctype/lms_settings/lms_settings.json msgid "Payment Gateway" -msgstr "" +msgstr "Platni portal" #. Label of the payment_id (Data) field in DocType 'LMS Payment' #: lms/lms/doctype/lms_payment/lms_payment.json @@ -3944,7 +3944,7 @@ msgstr "" #. Label of the payment_received (Check) field in DocType 'LMS Payment' #: lms/lms/doctype/lms_payment/lms_payment.json msgid "Payment Received" -msgstr "" +msgstr "Plaćanje primljeno" #. Label of the payment_reminder_template (Link) field in DocType 'LMS #. Settings' @@ -3996,7 +3996,7 @@ msgstr "" #: lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json #: lms/lms/doctype/lms_mentor_request/lms_mentor_request.json msgid "Pending" -msgstr "" +msgstr "Na čekanju" #. Label of the percentage (Int) field in DocType 'LMS Quiz Submission' #: frontend/src/pages/QuizSubmission.vue:44 @@ -4016,7 +4016,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:99 msgid "Phone Number" -msgstr "" +msgstr "Broj telefona" #: frontend/src/components/CourseCardOverlay.vue:169 msgid "Please Login" @@ -4176,7 +4176,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:95 msgid "Postal Code" -msgstr "" +msgstr "Poštanski broj" #: frontend/src/pages/JobDetail.vue:114 msgid "Posted on" @@ -4229,7 +4229,7 @@ msgstr "" #: lms/lms/doctype/lms_batch/lms_batch.json #: lms/public/js/common_functions.js:368 msgid "Pricing" -msgstr "" +msgstr "Cene" #. Label of the pricing_tab (Tab Break) field in DocType 'LMS Course' #: frontend/src/pages/CourseForm.vue:198 @@ -4307,11 +4307,11 @@ msgstr "" #: lms/lms/doctype/lms_enrollment/lms_enrollment.json #: lms/lms/doctype/lms_program_member/lms_program_member.json msgid "Progress" -msgstr "" +msgstr "Napredak" #: lms/lms/report/course_progress_summary/course_progress_summary.py:77 msgid "Progress (%)" -msgstr "" +msgstr "Napredak (%)" #. Option for the 'Required Role' (Select) field in DocType 'Cohort Web Page' #. Option for the 'Visibility' (Select) field in DocType 'LMS Batch Old' @@ -4507,7 +4507,7 @@ msgstr "" #. Label of the reference_doctype (Link) field in DocType 'LMS Badge' #: lms/lms/doctype/lms_badge/lms_badge.json msgid "Reference Document Type" -msgstr "" +msgstr "Vrsta referentnog dokumenta" #: lms/templates/emails/community_course_membership.html:17 msgid "Regards" @@ -4576,7 +4576,7 @@ msgstr "" #. Label of the resume (Attach) field in DocType 'LMS Job Application' #: lms/job/doctype/lms_job_application/lms_job_application.json msgid "Resume" -msgstr "" +msgstr "Biografija" #. Label of the review (Small Text) field in DocType 'LMS Course Review' #. Label of a Link in the LMS Workspace @@ -4584,7 +4584,7 @@ msgstr "" #: lms/lms/doctype/lms_course_review/lms_course_review.json #: lms/lms/workspace/lms/lms.json lms/templates/reviews.html:143 msgid "Review" -msgstr "" +msgstr "Pregled" #: lms/templates/reviews.html:100 msgid "Review the course" @@ -4684,7 +4684,7 @@ msgstr "" #: frontend/src/pages/QuizSubmission.vue:14 #: lms/public/js/common_functions.js:405 msgid "Save" -msgstr "" +msgstr "Sačuvaj" #. Label of the schedule (Table) field in DocType 'Course Evaluator' #: lms/lms/doctype/course_evaluator/course_evaluator.json @@ -4712,7 +4712,7 @@ msgstr "" #: lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.json #: lms/templates/quiz/quiz.html:148 msgid "Score" -msgstr "" +msgstr "Ocena" #. Label of the score_out_of (Int) field in DocType 'LMS Quiz Submission' #: lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.json @@ -4722,7 +4722,7 @@ msgstr "" #: frontend/src/components/Evaluators.vue:15 #: frontend/src/components/Members.vue:15 frontend/src/pages/Jobs.vue:38 msgid "Search" -msgstr "" +msgstr "Pretraga" #: frontend/src/pages/CertifiedParticipants.vue:26 msgid "Search by Name" @@ -4805,7 +4805,7 @@ msgstr "" #: frontend/src/pages/BatchForm.vue:161 frontend/src/pages/CourseForm.vue:158 #: frontend/src/pages/ProfileRoles.vue:4 frontend/src/pages/QuizForm.vue:79 msgid "Settings" -msgstr "" +msgstr "Podešavanja" #: frontend/src/pages/ProfileAbout.vue:62 msgid "Share on" @@ -4938,7 +4938,7 @@ msgstr "" #: lms/lms/doctype/cohort_subgroup/cohort_subgroup.json #: lms/lms/doctype/cohort_web_page/cohort_web_page.json msgid "Slug" -msgstr "" +msgstr "Slug" #: frontend/src/components/BatchCard.vue:25 #: frontend/src/components/BatchOverlay.vue:19 @@ -4959,7 +4959,7 @@ msgstr "" #: lms/lms/doctype/lms_payment/lms_payment.json #: lms/lms/doctype/lms_source/lms_source.json msgid "Source" -msgstr "" +msgstr "Izvor" #. Option for the 'Role' (Select) field in DocType 'Cohort Staff' #. Option for the 'Member Type' (Select) field in DocType 'LMS Enrollment' @@ -4971,12 +4971,12 @@ msgstr "" #. Label of the stage (Select) field in DocType 'LMS Batch Old' #: lms/lms/doctype/lms_batch_old/lms_batch_old.json msgid "Stage" -msgstr "" +msgstr "Faza" #: frontend/src/components/LiveClass.vue:50 frontend/src/components/Quiz.vue:67 #: lms/templates/quiz/quiz.html:39 msgid "Start" -msgstr "" +msgstr "Početak" #. Label of the start_date (Date) field in DocType 'Education Detail' #. Label of the start_date (Date) field in DocType 'LMS Batch' @@ -4987,7 +4987,7 @@ msgstr "" #: lms/lms/doctype/lms_batch_old/lms_batch_old.json #: lms/public/js/common_functions.js:275 msgid "Start Date" -msgstr "" +msgstr "Datum početka" #: lms/templates/emails/batch_start_reminder.html:13 msgid "Start Date:" @@ -5035,7 +5035,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:83 msgid "State" -msgstr "" +msgstr "Stanje" #. Label of the tab_4_tab (Tab Break) field in DocType 'LMS Course' #. Label of the statistics (Check) field in DocType 'LMS Settings' @@ -5076,7 +5076,7 @@ msgstr "" #: lms/lms/doctype/lms_course_progress/lms_course_progress.json #: lms/lms/doctype/lms_mentor_request/lms_mentor_request.json msgid "Status" -msgstr "" +msgstr "Status" #: lms/templates/assessments.html:17 msgid "Status/Score" @@ -5123,7 +5123,7 @@ msgstr "" #: frontend/src/components/Modals/AnnouncementModal.vue:20 msgid "Subject" -msgstr "" +msgstr "Predmet" #: frontend/src/components/Assignment.vue:32 msgid "Submission" @@ -5152,7 +5152,7 @@ msgstr "" #: lms/templates/quiz/quiz.html:128 lms/templates/reviews.html:163 #: lms/www/new-sign-up.html:32 msgid "Submit" -msgstr "" +msgstr "Podnesi" #: frontend/src/components/Modals/JobApplicationModal.vue:23 msgid "Submit your resume to proceed with your application for this position. Upon submission, it will be shared with the job poster." @@ -5185,7 +5185,7 @@ msgstr "" #: frontend/src/pages/ProgramForm.vue:301 frontend/src/pages/QuizForm.vue:342 #: frontend/src/pages/QuizForm.vue:361 frontend/src/pages/QuizForm.vue:430 msgid "Success" -msgstr "" +msgstr "Uspeh" #. Label of the summary (Small Text) field in DocType 'LMS Certificate #. Evaluation' @@ -5254,7 +5254,7 @@ msgstr "" #: lms/lms/doctype/user_skill/user_skill.json #: lms/lms/doctype/zoom_settings/zoom_settings.json msgid "System Manager" -msgstr "" +msgstr "Sistem menadžer" #. Label of the tags (Data) field in DocType 'LMS Course' #: frontend/src/pages/CourseForm.vue:117 @@ -5280,7 +5280,7 @@ msgstr "" #: lms/lms/doctype/cohort_web_page/cohort_web_page.json #: lms/lms/doctype/lms_certificate/lms_certificate.json msgid "Template" -msgstr "" +msgstr "Šablon" #: lms/lms/user.py:40 msgid "Temporarily Disabled" @@ -5544,7 +5544,7 @@ msgstr "" #: lms/lms/doctype/work_experience/work_experience.json #: lms/public/js/common_functions.js:259 msgid "Title" -msgstr "" +msgstr "Naslov" #: frontend/src/components/Modals/ChapterModal.vue:175 msgid "Title is required" @@ -5554,12 +5554,12 @@ msgstr "" #: frontend/src/pages/ProfileEvaluator.vue:98 #: lms/lms/doctype/course_evaluator/course_evaluator.json msgid "To" -msgstr "" +msgstr "Za" #. Label of the to_date (Date) field in DocType 'Work Experience' #: lms/lms/doctype/work_experience/work_experience.json msgid "To Date" -msgstr "" +msgstr "Datum završetka" #: lms/lms/utils.py:1789 msgid "To join this batch, please contact the Administrator." @@ -5575,7 +5575,7 @@ msgstr "" #: frontend/src/pages/Billing.vue:53 msgid "Total" -msgstr "" +msgstr "Ukupno" #. Label of the total_marks (Int) field in DocType 'LMS Quiz' #: frontend/src/pages/QuizForm.vue:67 frontend/src/pages/Quizzes.vue:123 @@ -5624,7 +5624,7 @@ msgstr "" #: lms/lms/doctype/lms_quiz_question/lms_quiz_question.json #: lms/templates/assessments.html:14 msgid "Type" -msgstr "" +msgstr "Vrsta" #: frontend/src/components/Quiz.vue:615 msgid "Type your answer" @@ -5704,7 +5704,7 @@ msgstr "" #: frontend/src/components/PaymentSettings.vue:27 #: frontend/src/components/SettingDetails.vue:23 msgid "Update" -msgstr "" +msgstr "Ažuriraj" #: lms/templates/emails/community_course_membership.html:11 msgid "Update Password" @@ -5729,7 +5729,7 @@ msgstr "" #: lms/lms/doctype/cohort_staff/cohort_staff.json #: lms/lms/doctype/lms_course_interest/lms_course_interest.json msgid "User" -msgstr "" +msgstr "Korisnik" #. Label of the user_category (Select) field in DocType 'User' #: lms/fixtures/custom_field.json lms/templates/signup-form.html:17 @@ -5786,12 +5786,12 @@ msgstr "" #. Label of the value (Rating) field in DocType 'LMS Batch Feedback' #: lms/lms/doctype/lms_batch_feedback/lms_batch_feedback.json msgid "Value" -msgstr "" +msgstr "Vrednost" #. Option for the 'Event' (Select) field in DocType 'LMS Badge' #: lms/lms/doctype/lms_badge/lms_badge.json msgid "Value Change" -msgstr "" +msgstr "Promena vrednosti" #. Label of the video_link (Data) field in DocType 'LMS Course' #: lms/lms/doctype/lms_course/lms_course.json @@ -5800,7 +5800,7 @@ msgstr "" #: frontend/src/pages/Notifications.vue:38 msgid "View" -msgstr "" +msgstr "Prikaz" #: frontend/src/components/CertificationLinks.vue:10 #: frontend/src/components/Modals/Event.vue:67 @@ -6183,7 +6183,7 @@ msgstr "" #: lms/templates/reviews.html:25 msgid "ratings" -msgstr "" +msgstr "ocene" #: lms/templates/reviews.html:43 msgid "stars" From deba02745795661d1b8c3c75d5abc694f3bd7aad Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 18 Apr 2025 18:05:57 +0530 Subject: [PATCH 04/10] chore: identify user persona --- frontend/src/App.vue | 2 +- frontend/src/components/AppSidebar.vue | 2 +- frontend/src/pages/Courses.vue | 35 ++++- frontend/src/pages/PersonaForm.vue | 176 +++++++++++++++++++++++++ frontend/src/router.js | 5 + frontend/vite.config.js | 2 +- lms/lms/api.py | 19 +++ 7 files changed, 231 insertions(+), 10 deletions(-) create mode 100644 frontend/src/pages/PersonaForm.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d890f55a..c79397af 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -24,7 +24,7 @@ const router = useRouter() const noSidebar = ref(false) router.beforeEach((to, from, next) => { - if (to.query.fromLesson) { + if (to.query.fromLesson || to.path === '/persona') { noSidebar.value = true } else { noSidebar.value = false diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 50c4f318..0dcc59f0 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -76,7 +76,7 @@ />
{ + identifyUserPersona() setFiltersFromQuery() updateCourses() categories.value = [ @@ -145,16 +148,34 @@ const courses = createListResource({ pageLength: pageLength.value, start: start.value, onSuccess(data) { - let allCategories = data.map((course) => course.category) - allCategories = allCategories.filter( - (category, index) => allCategories.indexOf(category) === index && category - ) - if (categories.value.length <= allCategories.length) { - updateCategories(data) - } + setCategories(data) }, }) +const setCategories = (data) => { + let allCategories = data.map((course) => course.category) + allCategories = allCategories.filter( + (category, index) => allCategories.indexOf(category) === index && category + ) + if (categories.value.length <= allCategories.length) { + updateCategories(data) + } +} + +const identifyUserPersona = () => { + if (user.data?.is_system_manager) { + call('frappe.client.get_count', { + doctype: 'LMS Course', + }).then((data) => { + if (!data) { + router.push({ + name: 'PersonaForm', + }) + } + }) + } +} + const updateCourses = () => { updateFilters() courses.update({ diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue new file mode 100644 index 00000000..c2300d4d --- /dev/null +++ b/frontend/src/pages/PersonaForm.vue @@ -0,0 +1,176 @@ + + diff --git a/frontend/src/router.js b/frontend/src/router.js index 7eba6f7a..fb04cc7d 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -210,6 +210,11 @@ const routes = [ name: 'AssignmentSubmissionList', component: () => import('@/pages/AssignmentSubmissionList.vue'), }, + { + path: '/persona', + name: 'PersonaForm', + component: () => import('@/pages/PersonaForm.vue'), + }, ] let router = createRouter({ diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 4be6085e..16881bc4 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -25,7 +25,7 @@ export default defineConfig({ }), ], server: { - allowedHosts: ['fs', 'bs'], + allowedHosts: ['fs', 'persona'], }, resolve: { alias: { diff --git a/lms/lms/api.py b/lms/lms/api.py index cc8f7df0..229e9281 100644 --- a/lms/lms/api.py +++ b/lms/lms/api.py @@ -2,6 +2,7 @@ """ import json +import requests import frappe import zipfile import os @@ -1389,3 +1390,21 @@ def add_an_evaluator(email): evaluator.insert() return evaluator + + +@frappe.whitelist() +def capture_user_persona(site, role, number_of_students, use_case, frappe_products): + requests.post( + "https://school.frappe.io/api/method/capture_persona", + json={ + "site": site, + "role": role, + "number_of_students": number_of_students, + "use_case": use_case, + "frappe_products": frappe_products, + }, + headers={ + "Authorization": f"token {frappe.local.conf.frappe_token}", + "Content-Type": "application/json", + }, + ) From c0ba44cacc9bb1d5a5c6a8398ffa69941bc08782 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 22 Apr 2025 15:02:21 +0530 Subject: [PATCH 05/10] fix: check persona_captured after details get saved --- frappe-ui | 2 +- frontend/src/pages/Courses.vue | 17 +++++++-- frontend/src/pages/PersonaForm.vue | 27 ++++++++++++-- lms/lms/api.py | 36 +++++++++---------- .../doctype/lms_settings/lms_settings.json | 29 +++++---------- 5 files changed, 66 insertions(+), 45 deletions(-) diff --git a/frappe-ui b/frappe-ui index 29307e4f..8cd9b06a 160000 --- a/frappe-ui +++ b/frappe-ui @@ -1 +1 @@ -Subproject commit 29307e4fffaacdbb3d9c5d95c5270b2f245a5607 +Subproject commit 8cd9b06a5ed50dc181d9672b2fe84c1594b52b48 diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index d46d96ab..61f514f5 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -162,8 +162,21 @@ const setCategories = (data) => { } } -const identifyUserPersona = () => { - if (user.data?.is_system_manager) { +const isPersonaCaptured = async () => { + let persona = await call('frappe.client.get_single_value', { + doctype: 'LMS Settings', + field: 'persona_captured', + }) + return persona +} + +const identifyUserPersona = async () => { + let personaCaptured = await isPersonaCaptured() + if ( + user.data?.is_system_manager && + !user.data?.developer_mode && + !personaCaptured + ) { call('frappe.client.get_count', { doctype: 'LMS Course', }).then((data) => { diff --git a/frontend/src/pages/PersonaForm.vue b/frontend/src/pages/PersonaForm.vue index c2300d4d..0ba7cf4d 100644 --- a/frontend/src/pages/PersonaForm.vue +++ b/frontend/src/pages/PersonaForm.vue @@ -1,6 +1,6 @@ @@ -81,6 +87,7 @@ import { sessionStore } from '@/stores/session' const user = inject('$user') const router = useRouter() const { brand } = sessionStore() +console.log(user.data?.sitename) const persona = reactive({ role: null, @@ -90,12 +97,28 @@ const persona = reactive({ }) const submitPersona = () => { - call('lms.lms.api.capture_user_persona', { + let responses = { site: user.data?.sitename, role: persona.role, no_of_students: persona.noOfStudents, use_case: persona.useCase, frappe_products: persona.frappeProducts, + } + call('lms.lms.api.capture_user_persona', { + responses: JSON.stringify(responses), + }).then(() => { + router.push({ + name: 'Courses', + }) + }) +} + +const skipPersonaForm = () => { + call('frappe.client.set_value', { + doctype: 'LMS Settings', + name: null, + fieldname: 'persona_captured', + value: 1, }).then(() => { router.push({ name: 'Courses', diff --git a/lms/lms/api.py b/lms/lms/api.py index 229e9281..1a133532 100644 --- a/lms/lms/api.py +++ b/lms/lms/api.py @@ -2,7 +2,6 @@ """ import json -import requests import frappe import zipfile import os @@ -185,9 +184,10 @@ def get_user_info(): ) user.is_fc_site = is_fc_site() user.is_system_manager = "System Manager" in user.roles + user.sitename = frappe.local.site + user.developer_mode = frappe.conf.developer_mode if user.is_fc_site and user.is_system_manager: user.site_info = current_site_info() - user.sitename = frappe.local.site return user @@ -679,13 +679,13 @@ def get_categories(doctype, filters): @frappe.whitelist() def get_members(start=0, search=""): """Get members for the given search term and start index. - Args: start (int): Start index for the query. + Args: start (int): Start index for the query. <<<<<<< HEAD - search (str): Search term to filter the results. + search (str): Search term to filter the results. ======= - search (str): Search term to filter the results. + search (str): Search term to filter the results. >>>>>>> 4869bba7bbb2fb38477d6fc29fb3b5838e075577 - Returns: List of members. + Returns: List of members. """ filters = {"enabled": 1, "name": ["not in", ["Administrator", "Guest"]]} @@ -1393,18 +1393,14 @@ def add_an_evaluator(email): @frappe.whitelist() -def capture_user_persona(site, role, number_of_students, use_case, frappe_products): - requests.post( - "https://school.frappe.io/api/method/capture_persona", - json={ - "site": site, - "role": role, - "number_of_students": number_of_students, - "use_case": use_case, - "frappe_products": frappe_products, - }, - headers={ - "Authorization": f"token {frappe.local.conf.frappe_token}", - "Content-Type": "application/json", - }, +def capture_user_persona(responses): + frappe.only_for("System Manager") + data = frappe.parse_json(responses) + data = json.dumps(data) + response = frappe.integrations.utils.make_post_request( + "https://school.frappe.io/api/method/capture-persona", + data={"response": data}, ) + if response.get("message").get("name"): + frappe.db.set_single_value("LMS Settings", "persona_captured", True) + return response diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json index 772a6fbe..597fee53 100644 --- a/lms/lms/doctype/lms_settings/lms_settings.json +++ b/lms/lms/doctype/lms_settings/lms_settings.json @@ -8,6 +8,7 @@ "general_tab", "default_home", "send_calendar_invite_for_evaluations", + "persona_captured", "column_break_zdel", "allow_guest_access", "enable_learning_paths", @@ -60,10 +61,7 @@ "column_break_uwsp", "payment_reminder_template", "seo_tab", - "meta_description", - "meta_image", - "column_break_xijv", - "meta_keywords" + "meta_description" ], "fields": [ { @@ -375,28 +373,19 @@ "label": "Meta Description" }, { - "description": "This image will be shown on lists and pages that don't have an image by default", - "fieldname": "meta_image", - "fieldtype": "Attach Image", - "label": "Meta Image" - }, - { - "description": "Common keywords that will be used for all pages", - "fieldname": "meta_keywords", - "fieldtype": "Small Text", - "label": "Meta Keywords" - }, - { - "fieldname": "column_break_xijv", - "fieldtype": "Column Break" + "default": "0", + "fieldname": "persona_captured", + "fieldtype": "Check", + "label": "Persona Captured", + "read_only": 1 } ], "grid_page_length": 50, "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2025-04-19 12:19:24.037931", - "modified_by": "sayali@frappe.io", + "modified": "2025-04-22 14:34:19.656896", + "modified_by": "Administrator", "module": "LMS", "name": "LMS Settings", "owner": "Administrator", From 3d81a634104439f73b9c2846e86c0b06f1aa8d2e Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 22 Apr 2025 15:32:01 +0530 Subject: [PATCH 06/10] ci: skip persona form for ui tests --- cypress/e2e/course_creation.cy.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 69c0f1ca..061fabb7 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -2,7 +2,10 @@ describe("Course Creation", () => { it("creates a new course", () => { cy.login(); cy.wait(1000); - cy.visit("/lms/courses"); + cy.visit("/lms"); + cy.wait(1000); + cy.get("div").contains("Skip").click(); + cy.wait(1000); // Create a course cy.get("button").contains("New").click(); @@ -19,13 +22,6 @@ describe("Course Creation", () => { ); cy.fixture("profile.png", "base64").then((fileContent) => { - /* cy.get('input[type="file"]').should("be.hidden").attachFile({ - fileContent, - fileName: "profile.png", - mimeType: "image/png", - encoding: "base64", - }); */ - cy.get("div") .contains("Course Image") .siblings("div") From 4128f0fb7372367b7f09ef30537786c0f670ba95 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 22 Apr 2025 16:17:29 +0530 Subject: [PATCH 07/10] chore: fixed settings --- .github/workflows/ui-tests.yml | 1 + cypress.config.js | 2 +- cypress/e2e/course_creation.cy.js | 5 +--- frontend/src/components/Modals/Settings.vue | 4 +-- frontend/src/pages/Courses.vue | 5 ++++ .../doctype/lms_settings/lms_settings.json | 27 ++++++++++++++++--- lms/lms/utils.py | 4 +++ 7 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 5338837c..f4b87366 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -100,6 +100,7 @@ jobs: bench --site lms.test execute frappe.utils.install.complete_setup_wizard bench --site lms.test execute frappe.tests.ui_test_helpers.create_test_user bench --site lms.test set-password frappe@example.com admin + bench --site lms.test execute lms.lms.utils.persona_captured - name: cypress pre-requisites run: | diff --git a/cypress.config.js b/cypress.config.js index 5e1c68ea..c7c1354e 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -13,6 +13,6 @@ module.exports = defineConfig({ openMode: 0, }, e2e: { - baseUrl: "http://testui:8000", + baseUrl: "http://pertest:8000", }, }); diff --git a/cypress/e2e/course_creation.cy.js b/cypress/e2e/course_creation.cy.js index 061fabb7..28b97041 100644 --- a/cypress/e2e/course_creation.cy.js +++ b/cypress/e2e/course_creation.cy.js @@ -2,10 +2,7 @@ describe("Course Creation", () => { it("creates a new course", () => { cy.login(); cy.wait(1000); - cy.visit("/lms"); - cy.wait(1000); - cy.get("div").contains("Skip").click(); - cy.wait(1000); + cy.visit("/lms/courses"); // Create a course cy.get("button").contains("New").click(); diff --git a/frontend/src/components/Modals/Settings.vue b/frontend/src/components/Modals/Settings.vue index ab89d535..315d066f 100644 --- a/frontend/src/components/Modals/Settings.vue +++ b/frontend/src/components/Modals/Settings.vue @@ -322,11 +322,11 @@ const tabsStructure = computed(() => { icon: 'LogIn', fields: [ { - label: 'Identify User Persona', + label: 'Identify User Category', name: 'user_category', type: 'checkbox', description: - 'Enable this option to identify the user persona during signup.', + 'Enable this option to identify the user category during signup.', }, { label: 'Disable signup', diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 61f514f5..58b4717a 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -172,6 +172,11 @@ const isPersonaCaptured = async () => { const identifyUserPersona = async () => { let personaCaptured = await isPersonaCaptured() + debugger + console.log('personaCaptured', personaCaptured) + console.log('user.data?.is_system_manager', user.data?.is_system_manager) + console.log('user.data?.developer_mode', user.data?.developer_mode) + if ( user.data?.is_system_manager && !user.data?.developer_mode && diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json index 597fee53..8bf72de4 100644 --- a/lms/lms/doctype/lms_settings/lms_settings.json +++ b/lms/lms/doctype/lms_settings/lms_settings.json @@ -61,7 +61,10 @@ "column_break_uwsp", "payment_reminder_template", "seo_tab", - "meta_description" + "meta_description", + "meta_image", + "column_break_xijv", + "meta_keywords" ], "fields": [ { @@ -106,7 +109,7 @@ "default": "0", "fieldname": "user_category", "fieldtype": "Check", - "label": "Identify User Persona" + "label": "Identify User Category" }, { "default": "0", @@ -372,6 +375,22 @@ "fieldtype": "Small Text", "label": "Meta Description" }, + { + "description": "This image will be shown on lists and pages that don't have an image by default", + "fieldname": "meta_image", + "fieldtype": "Attach Image", + "label": "Meta Image" + }, + { + "fieldname": "column_break_xijv", + "fieldtype": "Column Break" + }, + { + "description": "Common keywords that will be used for all pages", + "fieldname": "meta_keywords", + "fieldtype": "Small Text", + "label": "Meta Keywords" + }, { "default": "0", "fieldname": "persona_captured", @@ -384,8 +403,8 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2025-04-22 14:34:19.656896", - "modified_by": "Administrator", + "modified": "2025-04-22 16:05:27.914422", + "modified_by": "sayali@frappe.io", "module": "LMS", "name": "LMS Settings", "owner": "Administrator", diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 9a39b4a9..83e219ec 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -2167,3 +2167,7 @@ def get_palette(full_name): hash_name = hashlib.md5(encoded_name).hexdigest() idx = cint((int(hash_name[4:6], 16) + 1) / 5.33) return palette[idx % 8] + + +def persona_captured(): + frappe.db.set_single_value("LMS Settings", "persona_captured", 1) From 513f1e8b864159be27617291ca0540a2f38aa13a Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 22 Apr 2025 18:05:07 +0530 Subject: [PATCH 08/10] fix: improved lesson locked state --- frontend/src/components/UserDropdown.vue | 5 --- frontend/src/pages/Courses.vue | 13 ++---- frontend/src/pages/Lesson.vue | 50 +++++++++++++++--------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/UserDropdown.vue b/frontend/src/components/UserDropdown.vue index d8fd2eaa..eaffdf0d 100644 --- a/frontend/src/components/UserDropdown.vue +++ b/frontend/src/components/UserDropdown.vue @@ -194,11 +194,6 @@ const userDropdownOptions = computed(() => { ) }, }, - ], - }, - { - group: '', - items: [ { icon: LogOut, label: 'Log out', diff --git a/frontend/src/pages/Courses.vue b/frontend/src/pages/Courses.vue index 58b4717a..3fd44c53 100644 --- a/frontend/src/pages/Courses.vue +++ b/frontend/src/pages/Courses.vue @@ -171,17 +171,10 @@ const isPersonaCaptured = async () => { } const identifyUserPersona = async () => { - let personaCaptured = await isPersonaCaptured() - debugger - console.log('personaCaptured', personaCaptured) - console.log('user.data?.is_system_manager', user.data?.is_system_manager) - console.log('user.data?.developer_mode', user.data?.developer_mode) + if (user.data?.is_system_manager && !user.data?.developer_mode) { + let personaCaptured = await isPersonaCaptured() + if (personaCaptured) return - if ( - user.data?.is_system_manager && - !user.data?.developer_mode && - !personaCaptured - ) { call('frappe.client.get_count', { doctype: 'LMS Course', }).then((data) => { diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index fecaf6e4..01216a07 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -7,24 +7,33 @@
-
-

- {{ - __( - 'This lesson is not available for preview. Please enroll in the course to access it.' - ) - }} -

- - +
+
+
+ +
+ {{ __('This lesson is locked') }} +
+
+
+ {{ + __( + 'This lesson is not available for preview. Please enroll in the course to access it.' + ) + }} +
+ + +
+
@@ -198,7 +207,12 @@ import { computed, watch, inject, ref, onMounted, onBeforeUnmount } from 'vue' import CourseOutline from '@/components/CourseOutline.vue' import UserAvatar from '@/components/UserAvatar.vue' import { useRouter, useRoute } from 'vue-router' -import { ChevronLeft, ChevronRight, GraduationCap } from 'lucide-vue-next' +import { + ChevronLeft, + ChevronRight, + LockKeyholeIcon, + LogIn, +} from 'lucide-vue-next' import Discussions from '@/components/Discussions.vue' import { getEditorTools } from '../utils' import { sessionStore } from '@/stores/session' From befa3d7a6d063aa15fc8746c8a8d9a03b67a0498 Mon Sep 17 00:00:00 2001 From: safe user Date: Wed, 23 Apr 2025 11:50:40 +0000 Subject: [PATCH 09/10] feat: Added embedding for CloudflareStream --- frontend/src/utils/index.js | 7 +++++++ lms/lms/utils.py | 1 + 2 files changed, 8 insertions(+) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 7339f3dd..9c717596 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -258,6 +258,13 @@ export function getEditorTools() { };" frameborder="0" allowfullscreen>`, id: ([id]) => id, }, + cloudflareStream: { + regex: /https:\/\/customer-[a-z0-9]+\.cloudflarestream\.com\/([a-f0-9]{32})\/watch/, + embedUrl: 'https://iframe.videodelivery.net/<%= remote_id %>', + html: ``, + }, codepen: true, aparat: { regex: /(?:http[s]?:\/\/)?(?:www.)?aparat\.com\/v\/([^\/\?\&]+)\/?/, diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 83e219ec..26c4903a 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -181,6 +181,7 @@ def get_lesson_icon(body, content): if block.get("type") == "embed" and block.get("data").get("service") in [ "youtube", "vimeo", + "cloudflareStream" ]: return "icon-youtube" From badaa33ddb7006c61c797809871aef3ae1e01304 Mon Sep 17 00:00:00 2001 From: safe user Date: Thu, 24 Apr 2025 07:01:55 +0000 Subject: [PATCH 10/10] feat: Embedding for CloudflareStream --- frontend/src/utils/index.js | 3 ++- lms/lms/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 9c717596..f2c24ce2 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -260,7 +260,8 @@ export function getEditorTools() { }, cloudflareStream: { regex: /https:\/\/customer-[a-z0-9]+\.cloudflarestream\.com\/([a-f0-9]{32})\/watch/, - embedUrl: 'https://iframe.videodelivery.net/<%= remote_id %>', + embedUrl: + 'https://iframe.videodelivery.net/<%= remote_id %>', html: ``, diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 26c4903a..a069acb7 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -181,7 +181,7 @@ def get_lesson_icon(body, content): if block.get("type") == "embed" and block.get("data").get("service") in [ "youtube", "vimeo", - "cloudflareStream" + "cloudflareStream", ]: return "icon-youtube"