diff --git a/apps/dashboard/src/lib/components/Course/components/NewsFeed/NewsFeedCard.svelte b/apps/dashboard/src/lib/components/Course/components/NewsFeed/NewsFeedCard.svelte
index c848e8a3..51c60723 100644
--- a/apps/dashboard/src/lib/components/Course/components/NewsFeed/NewsFeedCard.svelte
+++ b/apps/dashboard/src/lib/components/Course/components/NewsFeed/NewsFeedCard.svelte
@@ -30,7 +30,9 @@
let comment = '';
let areCommentsExpanded = false;
let isDeleteFeedModal = false;
- let errors = {};
+ let errors: {
+ newComment: string;
+ };
let reactions = {
smile: '😀',
@@ -58,7 +60,7 @@
const handleAddNewComment = (event) => {
if (event.key === 'Enter' || event.type === 'click') {
- errors = addNewsfeedCommentValidation(comment);
+ errors = addNewsfeedCommentValidation(comment) as typeof errors;
if (Object.keys(errors).length) {
return;
}
@@ -230,8 +232,8 @@
{errors.newComment}
+ {#if errors?.newComment} +{errors?.newComment}
{/if}+ {$t('course.navItem.landing_page.editor.certificate_form.upload_template')} +
++ {$t('course.navItem.landing_page.editor.display_section')} +
+ ++ {$t('course.navItem.landing_page.editor.display_section')} +
+ ++ {$t('course.navItem.landing_page.editor.display_section')} +
+ ++ {$t('course.navItem.landing_page.editor.display_section')} +
+ +{discount}% {$t('course.navItem.landing_page.pricing_section.discount')}. - {formatter?.format(courseData?.cost || 0) || courseData.cost} + + {formatter?.format(courseData?.cost || 0) || courseData.cost} +
{/if} {:else} @@ -180,7 +179,7 @@ {#if courseData?.metadata?.reward?.show}{lesson.title}
- - - -{#if isOnLandingPage} - {!cost - ? $t('course.navItem.landing_page.pricing_section.free') - : formatter.format(cost)} + + {#if !cost} + $t('course.navItem.landing_page.pricing_section.free') + {:else if pricingData.showDiscount} + {formatter.format(cost)} + + {formatter?.format(pricingData?.cost)} + + {:else} + {formatter.format(cost)} + {/if} + {:else if isLMS} {#if !isExplore}
diff --git a/apps/dashboard/src/lib/utils/functions/course.ts b/apps/dashboard/src/lib/utils/functions/course.ts
index 2730eacd..2a5d7b33 100644
--- a/apps/dashboard/src/lib/utils/functions/course.ts
+++ b/apps/dashboard/src/lib/utils/functions/course.ts
@@ -29,3 +29,10 @@ export function replaceHTMLTag(text: string) {
.map((char) => tagsToReplace[char] || char)
.join('');
}
+
+export function calcCourseDiscount(percent = 0, cost: number, showDiscount: boolean) {
+ if (!percent || !showDiscount) return cost;
+ const discountAmount = (percent / 100) * cost;
+ const discountedPrice = cost - discountAmount;
+ return Math.round(discountedPrice);
+}
diff --git a/apps/dashboard/src/lib/utils/store/org.ts b/apps/dashboard/src/lib/utils/store/org.ts
index 0fc379b5..a3aba642 100644
--- a/apps/dashboard/src/lib/utils/store/org.ts
+++ b/apps/dashboard/src/lib/utils/store/org.ts
@@ -51,11 +51,11 @@ export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
: '';
});
-// Utility org store
-export const isFreePlan = derived(
- currentOrgPlan,
- ($plan) => !$plan || $plan.plan_name === PLAN.BASIC
-);
+export const isFreePlan = derived(currentOrgPlan, ($plan) => {
+ if (!$plan) return false;
+
+ return !$plan || $plan.plan_name === PLAN.BASIC;
+});
export const currentOrgMaxAudience = derived(currentOrgPlan, ($plan) =>
!$plan
? 20
diff --git a/apps/dashboard/src/lib/utils/translations/de.json b/apps/dashboard/src/lib/utils/translations/de.json
index fc433ca6..e8d6fc5d 100644
--- a/apps/dashboard/src/lib/utils/translations/de.json
+++ b/apps/dashboard/src/lib/utils/translations/de.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Kursinhalte",
- "modules": "Module",
+ "modules": "module",
"lessons": "Unterricht",
"exercises": "Übungen"
},
@@ -1430,4 +1430,4 @@
"no": "NEIN",
"yes": "Ja"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/translations/en.json b/apps/dashboard/src/lib/utils/translations/en.json
index e5a1dc50..fbac4217 100644
--- a/apps/dashboard/src/lib/utils/translations/en.json
+++ b/apps/dashboard/src/lib/utils/translations/en.json
@@ -923,12 +923,14 @@
"goals": "Goals",
"reviews": "Reviews",
"instructor": "Instructor",
- "pricing": "Pricing"
+ "pricing": "Pricing",
+ "certificate": "Certificate"
},
"save": "Save",
"page_builder": "Page Builder",
"section": "section",
+ "display_section": "Display section",
"header_form": {
"title": "Title",
@@ -962,6 +964,10 @@
}
},
+ "certificate_form": {
+ "upload_template": "Certificate template"
+ },
+
"instructor_form": {
"upload": "Instructor Logo",
"name": "Instructor name",
@@ -1002,7 +1008,7 @@
},
"course_content": "Course content",
- "modules": "Modules",
+ "modules": "modules",
"lessons": "lessons",
"exercises": "exercises",
"start_course": "Start Course",
diff --git a/apps/dashboard/src/lib/utils/translations/es.json b/apps/dashboard/src/lib/utils/translations/es.json
index a5299b95..d59fe673 100644
--- a/apps/dashboard/src/lib/utils/translations/es.json
+++ b/apps/dashboard/src/lib/utils/translations/es.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Contenido del curso",
- "modules": "Módulos",
+ "modules": "módulos",
"lessons": "lecciones",
"exercises": "ceremonias"
},
@@ -1430,4 +1430,4 @@
"no": "No",
"yes": "Sí"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/translations/fr.json b/apps/dashboard/src/lib/utils/translations/fr.json
index ac26ba4c..74c07b2c 100644
--- a/apps/dashboard/src/lib/utils/translations/fr.json
+++ b/apps/dashboard/src/lib/utils/translations/fr.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Contenu du cours",
- "modules": "Modules",
+ "modules": "modules",
"lessons": "leçons",
"exercises": "exercices"
},
@@ -1430,4 +1430,4 @@
"no": "Non",
"yes": "Oui"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/translations/pt.json b/apps/dashboard/src/lib/utils/translations/pt.json
index 1851bce9..9dc1da8a 100644
--- a/apps/dashboard/src/lib/utils/translations/pt.json
+++ b/apps/dashboard/src/lib/utils/translations/pt.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Conteúdo do curso",
- "modules": "Módulos",
+ "modules": "módulos",
"lessons": "lições",
"exercises": "exercícios"
},
@@ -1430,4 +1430,4 @@
"no": "Não",
"yes": "Sim"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/translations/ru.json b/apps/dashboard/src/lib/utils/translations/ru.json
index 548b5d4a..c003c271 100644
--- a/apps/dashboard/src/lib/utils/translations/ru.json
+++ b/apps/dashboard/src/lib/utils/translations/ru.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Содержание курса",
- "modules": "Модули",
+ "modules": "mодули",
"lessons": "уроки",
"exercises": "упражнения"
},
@@ -1430,4 +1430,4 @@
"no": "Нет",
"yes": "Да"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/translations/vi.json b/apps/dashboard/src/lib/utils/translations/vi.json
index c7d17be6..0432279b 100644
--- a/apps/dashboard/src/lib/utils/translations/vi.json
+++ b/apps/dashboard/src/lib/utils/translations/vi.json
@@ -395,7 +395,7 @@
}
},
"course_content": "Nội dung khóa học",
- "modules": "Mô-đun",
+ "modules": "mô-đun",
"lessons": "bài học",
"exercises": "bài tập"
},
@@ -1430,4 +1430,4 @@
"no": "KHÔNG",
"yes": "Đúng"
}
-}
\ No newline at end of file
+}
diff --git a/apps/dashboard/src/lib/utils/types/index.ts b/apps/dashboard/src/lib/utils/types/index.ts
index 55c22250..768b0a08 100644
--- a/apps/dashboard/src/lib/utils/types/index.ts
+++ b/apps/dashboard/src/lib/utils/types/index.ts
@@ -97,11 +97,15 @@ interface CourseMetadata {
description: string;
imgUrl: string;
};
+ certificate?: {
+ templateUrl: string;
+ };
reviews?: Array