feat: students can view org landing page from LMS
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="{className} w-full max-w-[500px] mx-auto h-[350px] flex items-center justify-center flex-col border rounded border-gray-200 dark:border-neutral-600"
|
||||
class="{className} w-full h-[517px] flex items-center justify-center flex-col border rounded border-gray-200 dark:border-neutral-600"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -5,14 +5,22 @@
|
||||
import { currentOrgDomain } from '$lib/utils/store/org';
|
||||
import { isMobile } from '$lib/utils/store/useMobile';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import { user } from '$lib/utils/store/user';
|
||||
|
||||
export let className = '';
|
||||
export let isLMS = false;
|
||||
|
||||
$: href = isLMS && $user.isLoggedIn ? `${$currentOrgDomain}/home` : $currentOrgDomain;
|
||||
</script>
|
||||
|
||||
<a href={$currentOrgDomain} target="_blank" class="{className} ml-2 hover:no-underline">
|
||||
<a {href} target="_blank" class="{className} ml-2 hover:no-underline">
|
||||
<PrimaryButton variant={VARIANTS.CONTAINED_DARK}>
|
||||
{#if !$isMobile}
|
||||
{$t('settings.subheadings.view_site')}
|
||||
{#if isLMS}
|
||||
{$t('dashboard.visit_site')}
|
||||
{:else}
|
||||
{$t('settings.subheadings.view_site')}
|
||||
{/if}
|
||||
{/if}
|
||||
<ArrowUpRightIcon />
|
||||
</PrimaryButton>
|
||||
|
||||
+3
-6
@@ -5,9 +5,7 @@
|
||||
lesson,
|
||||
lessonByTranslation
|
||||
} from '$lib/components/Course/components/Lesson/store/lessons';
|
||||
import Box from '$lib/components/Box/index.svelte';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
import AlignBoxTopLeft from 'carbon-icons-svelte/lib/AlignBoxTopLeft.svelte';
|
||||
import { lessonFallbackNote } from '$lib/utils/functions/translations';
|
||||
|
||||
export let lessonId: string;
|
||||
@@ -31,10 +29,9 @@
|
||||
</svelte:fragment>
|
||||
</HtmlRender>
|
||||
{:else if hasAtLeastOneTranslation}
|
||||
<Box className="text-center">
|
||||
<AlignBoxTopLeft class="carbon-icon" size={32} />
|
||||
<h3 class="text-lg font-normal dark:text-white py-2">
|
||||
<div class="flex items-center justify-center flex-col text-center">
|
||||
<h3 class="text-lg font-normal italic dark:text-white py-2">
|
||||
{$t('course.navItem.lessons.materials.no_translation')}
|
||||
</h3>
|
||||
</Box>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -109,18 +109,22 @@
|
||||
return youtubeRegex.test(link.trim());
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
if (!orgSiteName) return;
|
||||
$: loadData(orgSiteName);
|
||||
|
||||
async function loadData(siteName) {
|
||||
if (!siteName) return;
|
||||
|
||||
try {
|
||||
console.log('sitename', orgSiteName);
|
||||
console.log('sitename', siteName);
|
||||
$courseMetaDeta.isLoading = true;
|
||||
const coursesResult = await getCourseBySiteName(orgSiteName);
|
||||
const coursesResult = await getCourseBySiteName(siteName);
|
||||
courses.set(coursesResult);
|
||||
$courseMetaDeta.isLoading = false;
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initPlyr(_player: any, _video: string | undefined) {
|
||||
if (!player) return;
|
||||
|
||||
@@ -162,7 +166,13 @@
|
||||
<!-- Header Section -->
|
||||
{#if $landingPageSettings.header.show}
|
||||
<header id="header" class="banner w-full h-[100vh] md:h-[90vh] mb-10 relative">
|
||||
<Navigation logo={org.avatar_url} orgName={org.name} disableSignup={true} />
|
||||
<Navigation
|
||||
logo={org.avatar_url}
|
||||
orgName={org.name}
|
||||
disableSignup={true}
|
||||
isOrgSite={true}
|
||||
/>
|
||||
|
||||
<div class="absolute h-[100vh] md:h-[90vh] top-0 w-full opacity-80 z-10 bg-white" />
|
||||
{#if $landingPageSettings.header.banner.show}
|
||||
<div class="flex items-center justify-center md:h-full py-2">
|
||||
|
||||
Reference in New Issue
Block a user