From 4bc3ac1665d26098ef944ab5d9109b08f5175b53 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 18 Jul 2024 21:29:40 +0530 Subject: [PATCH 1/3] fix: batch filters on desk --- frontend/package.json | 2 +- frontend/src/components/AppSidebar.vue | 2 +- frontend/src/utils/index.js | 64 +++++++++++++++++++++++++- frontend/yarn.lock | 15 ++---- 4 files changed, 69 insertions(+), 14 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 6775773db..82258fe44 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,7 +14,7 @@ "@editorjs/editorjs": "^2.29.0", "@editorjs/embed": "^2.7.0", "@editorjs/header": "^2.8.1", - "@editorjs/image": "^2.9.0", + "@editorjs/image": "^2.9.2", "@editorjs/inline-code": "^1.5.0", "@editorjs/nested-list": "^1.4.2", "@editorjs/paragraph": "^2.11.3", diff --git a/frontend/src/components/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 3e62170ff..49f33da6a 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -27,7 +27,7 @@ >
', + html: '', + height: 320, + width: 580, + id: ([id, params]) => { + if (!params && id) { + return id + } + + const paramsMap: Record = { + start: 'start', + end: 'end', + t: 'start', + // eslint-disable-next-line camelcase + time_continue: 'start', + list: 'list', + } + + let newParams = params + .slice(1) + .split('&') + .map((param) => { + const [name, value] = param.split('=') + + if (!id && name === 'v') { + id = value + + return null + } + + if (!paramsMap[name]) { + return null + } + + if ( + value === 'LL' || + value.startsWith('RDMM') || + value.startsWith('FL') + ) { + return null + } + + return `${paramsMap[name]}=${value}` + }) + .filter((param) => !!param) + + return id + '?' + newParams.join('&') + }, + }, vimeo: true, codepen: true, - aparat: 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, + }, github: true, slides: { regex: /https:\/\/docs\.google\.com\/presentation\/d\/e\/([A-Za-z0-9_-]+)\/pub/, diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 831fadb17..254beaeab 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -27,11 +27,6 @@ resolved "https://registry.yarnpkg.com/@codexteam/icons/-/icons-0.0.5.tgz#d17f39b6a0497c6439f57dd42711817a3dd3679c" integrity sha512-s6H2KXhLz2rgbMZSkRm8dsMJvyUNZsEjxobBEg9ztdrb1B2H3pEzY6iTwI4XUPJWJ3c3qRKwV4TrO3J5jUdoQA== -"@codexteam/icons@^0.0.6": - version "0.0.6" - resolved "https://registry.yarnpkg.com/@codexteam/icons/-/icons-0.0.6.tgz#5553ada48dddf5940851ccc142cfe17835c36ad3" - integrity sha512-L7Q5PET8PjKcBT5wp7VR+FCjwCi5PUp7rd/XjsgQ0CI5FJz0DphyHGRILMuDUdCW2MQT9NHbVr4QP31vwAkS/A== - "@codexteam/icons@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@codexteam/icons/-/icons-0.3.0.tgz#62380b4053d487a257de443864b5c72dafab95e6" @@ -68,12 +63,12 @@ dependencies: "@codexteam/icons" "^0.0.5" -"@editorjs/image@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@editorjs/image/-/image-2.9.0.tgz#0c83252d569a0dc3af14c3f7d16b6df033b9c37b" - integrity sha512-xItihKJFiWJ06SMtLWQZvzHv4LRPNAFZYaHAXesBFzXvWwUrtVaVMcNSf0eNnw3InrPO3Po1vZRRgpsT+Ya3Bg== +"@editorjs/image@^2.9.2": + version "2.9.2" + resolved "https://registry.yarnpkg.com/@editorjs/image/-/image-2.9.2.tgz#c8bea65a578fab65a1a75df1223b4fd8f06b57d5" + integrity sha512-n09sMieGW8cksoeflpplzvbmFH2bdVzVTWbnidPWAHaeU467HRteoXU9yfGBB7+eeHZLnmCulQ2dr6ae+G2niw== dependencies: - "@codexteam/icons" "^0.0.6" + "@codexteam/icons" "^0.3.0" "@editorjs/inline-code@^1.5.0": version "1.5.0" From 69d266e01867ed738afc060a650a975a030f7318 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 19 Jul 2024 11:55:36 +0530 Subject: [PATCH 2/3] feat: image pasting --- frontend/package.json | 2 +- frontend/src/components/BatchCard.vue | 23 ++++--- frontend/src/pages/CreateLesson.vue | 7 ++- frontend/src/utils/image.js | 64 ++++++++++++++++++++ frontend/src/utils/index.js | 10 +-- frontend/yarn.lock | 12 ++++ lms/lms/doctype/lms_batch/lms_batch.json | 5 +- lms/lms/doctype/lms_batch/lms_batch.py | 1 + lms/templates/emails/batch_confirmation.html | 3 +- 9 files changed, 106 insertions(+), 21 deletions(-) create mode 100644 frontend/src/utils/image.js diff --git a/frontend/package.json b/frontend/package.json index 82258fe44..7935452aa 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,10 +14,10 @@ "@editorjs/editorjs": "^2.29.0", "@editorjs/embed": "^2.7.0", "@editorjs/header": "^2.8.1", - "@editorjs/image": "^2.9.2", "@editorjs/inline-code": "^1.5.0", "@editorjs/nested-list": "^1.4.2", "@editorjs/paragraph": "^2.11.3", + "@editorjs/simple-image": "^1.6.0", "chart.js": "^4.4.1", "dayjs": "^1.11.6", "feather-icons": "^4.28.0", diff --git a/frontend/src/components/BatchCard.vue b/frontend/src/components/BatchCard.vue index 84697c51f..734950c7e 100644 --- a/frontend/src/components/BatchCard.vue +++ b/frontend/src/components/BatchCard.vue @@ -3,6 +3,9 @@ class="flex flex-col shadow hover:bg-gray-100 rounded-md p-4 h-full" style="min-height: 150px" > +
+ {{ batch.title }} +
{{ __('Sold Out') }} -
- {{ batch.title }} -
{{ batch.description }}
@@ -29,23 +29,26 @@
{{ batch.price }}
-
- + -
+
{{ formatTime(batch.start_time) }} - {{ formatTime(batch.end_time) }}
-
- +
+ {{ batch.timezone }} diff --git a/frontend/src/pages/CreateLesson.vue b/frontend/src/pages/CreateLesson.vue index 7e7a47e30..cdd9703ac 100644 --- a/frontend/src/pages/CreateLesson.vue +++ b/frontend/src/pages/CreateLesson.vue @@ -43,7 +43,7 @@
@@ -54,7 +54,7 @@
@@ -439,7 +439,8 @@ const pageMeta = computed(() => { updateDocumentTitle(pageMeta)