chore: ui improvements on organisation stats #531

This commit is contained in:
Rotimi Best
2024-12-31 17:18:42 +01:00
parent c68bfb62b5
commit e4c599044e
9 changed files with 23 additions and 20 deletions
@@ -928,7 +928,8 @@
"recent_enrollments": "Aktuelle Anmeldungen",
"publish_first_course": "Veröffentlichen Sie Ihren ersten Kurs",
"publish_first_course_description": "Um Anmeldungen zu verfolgen, veröffentlichen Sie einen Kurs und laden Sie Studierende ein",
"publish_course": "Kurs veröffentlichen"
"publish_course": "Kurs veröffentlichen",
"student": "Student"
},
"schedule": {
"title": "Dein Zeitplan",
@@ -458,6 +458,7 @@
"total_students_description": "Based on student enrollments",
"top_courses": "Top Courses",
"students": "students",
"student": "student",
"completion": "completion",
"create_first_course": "Create Your First Course",
"create_first_course_description": "Start creating courses to track course progress",
@@ -928,7 +928,8 @@
"recent_enrollments": "Inscripciones recientes",
"publish_first_course": "Publica tu primer curso",
"publish_first_course_description": "Para realizar un seguimiento de las inscripciones, publicar un curso e invitar a estudiantes",
"publish_course": "Publicar curso"
"publish_course": "Publicar curso",
"student": "alumno"
},
"schedule": {
"title": "Tu agenda",
@@ -928,7 +928,8 @@
"recent_enrollments": "Inscriptions récentes",
"publish_first_course": "Publiez votre premier cours",
"publish_first_course_description": "Pour suivre les inscriptions, publier un cours et inviter des étudiants",
"publish_course": "Publier un cours"
"publish_course": "Publier un cours",
"student": "étudiant"
},
"schedule": {
"title": "Votre emploi du temps",
@@ -928,7 +928,8 @@
"recent_enrollments": "हाल के नामांकन",
"publish_first_course": "अपना पहला पाठ्यक्रम प्रकाशित करें",
"publish_first_course_description": "नामांकन पर नज़र रखने के लिए, एक पाठ्यक्रम प्रकाशित करें और छात्रों को आमंत्रित करें",
"publish_course": "पाठ्यक्रम प्रकाशित करें"
"publish_course": "पाठ्यक्रम प्रकाशित करें",
"student": "विद्यार्थी"
},
"schedule": {
"title": "आपका समय - सारणी",
@@ -928,7 +928,8 @@
"recent_enrollments": "Inscrições recentes",
"publish_first_course": "Publique seu primeiro curso",
"publish_first_course_description": "Para rastrear matrículas, publicar um curso e convidar alunos",
"publish_course": "Publicar curso"
"publish_course": "Publicar curso",
"student": "estudante"
},
"schedule": {
"title": "Sua programação",
@@ -928,7 +928,8 @@
"recent_enrollments": "Недавние регистрации",
"publish_first_course": "Опубликуйте свой первый курс",
"publish_first_course_description": "Чтобы отслеживать зачисления, опубликуйте курс и пригласите студентов.",
"publish_course": "Опубликовать курс"
"publish_course": "Опубликовать курс",
"student": "студент"
},
"schedule": {
"title": "Твое расписание",
@@ -928,7 +928,8 @@
"recent_enrollments": "Đăng ký gần đây",
"publish_first_course": "Xuất bản khóa học đầu tiên của bạn",
"publish_first_course_description": "Để theo dõi việc đăng ký, xuất bản một khóa học và mời sinh viên",
"publish_course": "Xuất bản khóa học"
"publish_course": "Xuất bản khóa học",
"student": "học sinh"
},
"schedule": {
"title": "Lịch trình của bạn",
@@ -8,7 +8,7 @@
import { snackbar } from '$lib/components/Snackbar/store';
import { calDateDiff } from '$lib/utils/functions/date';
import { getAccessToken } from '$lib/utils/functions/supabase';
import { currentOrg } from '$lib/utils/store/org';
import { currentOrg, currentOrgPath } from '$lib/utils/store/org';
import { profile } from '$lib/utils/store/user';
import type { OrganisationAnalytics } from '$lib/utils/types/analytics';
import Add from 'carbon-icons-svelte/lib/Add.svelte';
@@ -27,17 +27,12 @@
import { isMobile } from '$lib/utils/store/useMobile';
import { Grid, Link, SkeletonPlaceholder } from 'carbon-components-svelte';
export let data;
const { orgName } = data;
// export let data;
let dashAnalytics: OrganisationAnalytics;
function createCourse() {
goto(`/org/${orgName}/courses?create=true`);
}
function publishCourse() {
goto(`/org/${orgName}/courses`);
goto(`${$currentOrgPath}/courses?create=true`);
}
async function fetchDashAnalytics(orgId: string) {
@@ -162,7 +157,7 @@
</Link>
<p class="text-muted-foreground text-sm">
{course.enrollments}
{$t('dashboard.students')}
{$t(course.enrollments === 1 ? 'dashboard.student' : 'dashboard.students')}
</p>
</div>
<div class="ml-auto w-2/6">
@@ -221,7 +216,7 @@
/>
<div class="min-h-[45px] space-y-1">
<p class="text-md font-medium leading-none">{enrollment.name}</p>
<p class="text-sm font-medium leading-none">{enrollment.name}</p>
<p class="text-muted-foreground text-sm">
<span class="italic">
{calDateDiff(enrollment.date)}
@@ -230,9 +225,9 @@
</div>
</div>
<div>
<div class="w-2/4">
<Link href={`/courses/${enrollment.courseId}`}>
<p class="text-sm font-medium leading-none">
<p class="line-clamp-2 pb-[0.1rem] text-sm font-medium leading-none">
{enrollment.course}
</p>
</Link>
@@ -253,7 +248,7 @@
</div>
<PrimaryButton
variant={VARIANTS.OUTLINED}
onClick={publishCourse}
onClick={() => goto(`${$currentOrgPath}/courses`)}
label={$t('dashboard.publish_course')}
/>
</div>