CLASSROOMIO-T-11:Fixed the merge conflicts after careful review
This commit is contained in:
@@ -22,11 +22,27 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
let Selectedtheme = themes[0];
|
let Selectedtheme = themes[0];
|
||||||
|
let isSaving = false;
|
||||||
|
|
||||||
const saveCertificate = () => {};
|
|
||||||
const onToggle = (e) => {
|
const onToggle = (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
};
|
};
|
||||||
|
const saveCertificate = () => {
|
||||||
|
// set isSaving to true
|
||||||
|
// Validation - make sure description isn't empty
|
||||||
|
// Upload the brand logo to give you a URL
|
||||||
|
// Update organisation logo (like in `src/components/Org/Settings/OrgSettings.svelte` line 25-51)
|
||||||
|
// - Note from the file above both logo and name is updated, in this case we only want to update logo
|
||||||
|
/**
|
||||||
|
* Update only course description (like in src/components/Course/components/Settings/index.svelte)
|
||||||
|
*
|
||||||
|
* await updateCourse($course.id, undefined, {
|
||||||
|
description: $course.description,
|
||||||
|
is_certificate_downloadable: $course.is_certificate_downloadable
|
||||||
|
});
|
||||||
|
* */
|
||||||
|
// set isSaving to false
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="md:-ml-4 md:-mr-4">
|
<main class="md:-ml-4 md:-mr-4">
|
||||||
@@ -72,17 +88,16 @@
|
|||||||
placeholder="a little description about the course"
|
placeholder="a little description about the course"
|
||||||
bgColor="bg-gray-100"
|
bgColor="bg-gray-100"
|
||||||
bind:value={$course.description}
|
bind:value={$course.description}
|
||||||
onChange={$course.description}
|
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<Toggle
|
<Toggle
|
||||||
labelText="Add date of completion"
|
labelText="Allow students download certificate"
|
||||||
on:toggle={(e) => onToggle(e)}
|
bind:toggled={$course.is_certificate_downloadable}
|
||||||
class="my-2"
|
class="my-4"
|
||||||
size="sm"
|
size="sm"
|
||||||
>
|
>
|
||||||
<span slot="labelA" style="color: #161616">Date</span>
|
<span slot="labelA" style="color: #161616">Student access</span>
|
||||||
<span slot="labelB" style="color: green">Date</span>
|
<span slot="labelB" style="color: green">Student access</span>
|
||||||
</Toggle>
|
</Toggle>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -102,7 +117,8 @@
|
|||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
label="Save Changes"
|
label="Save Changes"
|
||||||
className="rounded-md"
|
className="rounded-md"
|
||||||
onClick={() => saveCertificate()}
|
onClick={saveCertificate}
|
||||||
|
isLoading={isSaving}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="border-b border-gray-500 mb-4">
|
<div class="border-b border-gray-500 mb-4">
|
||||||
<p class="text-xs text-black font-medium">This is to certify that</p>
|
<p class="text-xs text-black font-medium">This is to certify that</p>
|
||||||
|
<!-- TODO: Nothing in this file should be editable -->
|
||||||
<TextField
|
<TextField
|
||||||
bind:value={studentName}
|
bind:value={studentName}
|
||||||
inputClassName="text-center placeholder:text-black"
|
inputClassName="text-center placeholder:text-black"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="border-b border-gray-500 mb-4">
|
<div class="border-b border-gray-500 mb-4">
|
||||||
<p class="text-xs text-black font-medium">This is to certify that</p>
|
<p class="text-xs text-black font-medium">This is to certify that</p>
|
||||||
|
<!-- TODO: Nothing in this file should be editable -->
|
||||||
<TextField
|
<TextField
|
||||||
bind:value={studentName}
|
bind:value={studentName}
|
||||||
inputClassName="text-center placeholder:text-black"
|
inputClassName="text-center placeholder:text-black"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const course: Writable<Course> = writable({
|
|||||||
description: '',
|
description: '',
|
||||||
cost: 0,
|
cost: 0,
|
||||||
currency: '',
|
currency: '',
|
||||||
|
is_certificate_downloadable: false,
|
||||||
metadata: {
|
metadata: {
|
||||||
requirements: '',
|
requirements: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script context="module">
|
<script context="module">
|
||||||
import { fetchCourse } from '../../../utils/services/courses';
|
import { fetchCourse } from '../../../utils/services/courses';
|
||||||
|
|
||||||
export async function preload({ params }) {
|
export async function preload({ params = { id: '' } }) {
|
||||||
return { courseId: params.id };
|
return { courseId: params.id };
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -11,20 +11,22 @@
|
|||||||
import CourseContainer from '../../../components/CourseContainer/index.svelte';
|
import CourseContainer from '../../../components/CourseContainer/index.svelte';
|
||||||
|
|
||||||
import PageNav from '../../../components/PageNav/index.svelte';
|
import PageNav from '../../../components/PageNav/index.svelte';
|
||||||
import PrimaryButton from '../../../components/PrimaryButton/index.svelte';
|
// import PrimaryButton from '../../../components/PrimaryButton/index.svelte';
|
||||||
import PageBody from '../../../components/PageBody/index.svelte';
|
import PageBody from '../../../components/PageBody/index.svelte';
|
||||||
import RoleBasedSecurity from '../../../components/RoleBasedSecurity/index.svelte';
|
import RoleBasedSecurity from '../../../components/RoleBasedSecurity/index.svelte';
|
||||||
import { setCourse, course, group } from '../../../components/Course/store';
|
import { setCourse, course } from '../../../components/Course/store';
|
||||||
import IssueCertificateModal from '../../../components/Course/components/Ceritficate/IssueCertificateModal.svelte';
|
import IssueCertificateModal from '../../../components/Course/components/Ceritficate/IssueCertificateModal.svelte';
|
||||||
// import DeleteConfirmation from '../../../components/Course/components/People/DeleteConfirmation.svelte';
|
// import DeleteConfirmation from '../../../components/Course/components/People/DeleteConfirmation.svelte';
|
||||||
import Design from '../../../components/Course/components/Ceritficate/Design.svelte';
|
import Design from '../../../components/Course/components/Ceritficate/Design.svelte';
|
||||||
import Reports from '../../../components/Course/components/Ceritficate/Reports.svelte';
|
// import Reports from '../../../components/Course/components/Ceritficate/Reports.svelte';
|
||||||
|
|
||||||
import { issueCertificateModal } from '../../../components/Course/components/Ceritficate/store';
|
// import { issueCertificateModal } from '../../../components/Course/components/Ceritficate/store';
|
||||||
import { Tabs, Tab, TabContent } from 'carbon-components-svelte';
|
import { Tabs, Tab } from 'carbon-components-svelte';
|
||||||
|
import TabContent from 'carbon-components-svelte/src/Tabs/TabContent.svelte';
|
||||||
|
|
||||||
export let courseId: string = '';
|
export let courseId: string = '';
|
||||||
let isStudent = false;
|
let isStudent = false;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if ($course.id) return;
|
if ($course.id) return;
|
||||||
const { data } = await fetchCourse(courseId);
|
const { data } = await fetchCourse(courseId);
|
||||||
@@ -33,34 +35,35 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<IssueCertificateModal />
|
<IssueCertificateModal />
|
||||||
|
|
||||||
<CourseContainer bind:isStudent>
|
<CourseContainer bind:isStudent>
|
||||||
<PageNav title="Certificates" disableSticky={true}>
|
<PageNav title="Certificates" disableSticky={true}>
|
||||||
<slot:fragment slot="widget">
|
<slot:fragment slot="widget">
|
||||||
<RoleBasedSecurity allowedRoles={[1, 2]}>
|
<RoleBasedSecurity allowedRoles={[1, 2]}>
|
||||||
<PrimaryButton
|
<!-- Hide Functionality For V1 -->
|
||||||
|
<!-- <PrimaryButton
|
||||||
className="mr-2 rounded-md text-sm font-medium"
|
className="mr-2 rounded-md text-sm font-medium"
|
||||||
label="Issue Cert"
|
label="Issue Cert"
|
||||||
onClick={() => ($issueCertificateModal.open = true)}
|
onClick={() => ($issueCertificateModal.open = true)}
|
||||||
/>
|
/> -->
|
||||||
</RoleBasedSecurity>
|
</RoleBasedSecurity>
|
||||||
</slot:fragment>
|
</slot:fragment>
|
||||||
</PageNav>
|
</PageNav>
|
||||||
|
|
||||||
<PageBody className="w-full mx-0" padding="px-0">
|
<PageBody className="w-full mx-0" padding="px-0">
|
||||||
<Tabs autoWidth class="border-b border-gray-200">
|
<Tabs autoWidth class="border-b border-gray-200">
|
||||||
<Tab label="Design" />
|
<Tab label="Design" />
|
||||||
<Tab label="Reports" />
|
<!-- <Tab label="Reports" /> -->
|
||||||
<svelte:fragment slot="content">
|
<svelte:fragment slot="content">
|
||||||
<TabContent>
|
<TabContent>
|
||||||
<Design />
|
<Design />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
|
|
||||||
<TabContent>
|
<!-- Temp disable Reports tab for V2 -->
|
||||||
|
<!-- <TabContent>
|
||||||
<Reports />
|
<Reports />
|
||||||
</TabContent>
|
</TabContent> -->
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</PageBody>
|
</PageBody>
|
||||||
</CourseContainer>
|
</CourseContainer>
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ export interface Course {
|
|||||||
currency?: string;
|
currency?: string;
|
||||||
group?: Group;
|
group?: Group;
|
||||||
organization?: Organization;
|
organization?: Organization;
|
||||||
|
is_certificate_downloadable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Groupmember {
|
export interface Groupmember {
|
||||||
|
|||||||
Reference in New Issue
Block a user