2021-07-12 05:55:57 +03:00
|
|
|
<script context="module">
|
2021-08-18 19:47:02 +03:00
|
|
|
import { fetchCourse } from '../../../utils/services/courses';
|
2021-07-12 05:55:57 +03:00
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
export async function preload({ params }, session) {
|
|
|
|
|
if (process.browser) {
|
|
|
|
|
return {};
|
2021-07-13 16:27:02 +00:00
|
|
|
}
|
2021-08-18 19:47:02 +03:00
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
data,
|
|
|
|
|
// error
|
|
|
|
|
} = await fetchCourse(params.id, session);
|
|
|
|
|
|
|
|
|
|
return { courseData: data };
|
2021-07-12 05:55:57 +03:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-08-18 19:47:02 +03:00
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { stores } from '@sapper/app';
|
|
|
|
|
import CourseContainer from '../../../components/CourseContainer/index.svelte';
|
|
|
|
|
import PageNav from '../../../components/PageNav/index.svelte';
|
|
|
|
|
import UserCard from '../../../components/UserCard/index.svelte';
|
|
|
|
|
import { setCourseData } from '../../../components/Course/store';
|
2021-07-13 16:27:02 +00:00
|
|
|
|
|
|
|
|
export let courseData = {};
|
2021-07-12 05:55:57 +03:00
|
|
|
|
|
|
|
|
const { page } = stores();
|
|
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
const teachers = [];
|
2021-07-12 05:55:57 +03:00
|
|
|
const students = [...teachers, ...teachers, ...teachers];
|
2021-08-18 19:47:02 +03:00
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
setCourseData(courseData);
|
|
|
|
|
});
|
2021-07-12 05:55:57 +03:00
|
|
|
</script>
|
|
|
|
|
|
2021-08-18 19:47:02 +03:00
|
|
|
<CourseContainer>
|
2021-07-12 05:55:57 +03:00
|
|
|
<PageNav title="People" disableSticky={true} />
|
|
|
|
|
<div class="m-3">
|
|
|
|
|
<h3>
|
|
|
|
|
<a id="teachers" name="teachers" href="{$page.path}#teachers">Teachers</a>
|
|
|
|
|
</h3>
|
|
|
|
|
<div class="flex flex-wrap">
|
|
|
|
|
{#each teachers as teacher}
|
|
|
|
|
<UserCard
|
|
|
|
|
name={teacher.name}
|
|
|
|
|
avatarUrl={teacher.avatar}
|
|
|
|
|
title={teacher.title}
|
|
|
|
|
telegramLink={teacher.telegramLink}
|
|
|
|
|
mailLink={teacher.mailLink}
|
|
|
|
|
/>
|
|
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="m-3">
|
|
|
|
|
<h3>
|
|
|
|
|
<a id="students" name="students" href="{$page.path}#students">Students</a>
|
|
|
|
|
</h3>
|
|
|
|
|
<div class="flex flex-wrap">
|
|
|
|
|
{#each students as student}
|
|
|
|
|
<UserCard
|
|
|
|
|
name={student.name}
|
|
|
|
|
avatarUrl={student.avatar}
|
|
|
|
|
title={student.title}
|
|
|
|
|
/>
|
|
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CourseContainer>
|