-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display banner to indicate license expiration
- Loading branch information
1 parent
7ae9edf
commit f664688
Showing
4 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script lang="ts"> | ||
// Most of your app wide CSS should be put in this file | ||
import '../../app.postcss'; | ||
import { AppShell, AppBar } from '@skeletonlabs/skeleton'; | ||
import { safeTranslate } from '$lib/utils/i18n'; | ||
import SideBar from '$lib/components/SideBar/SideBar.svelte'; | ||
import Breadcrumbs from '$lib/components/Breadcrumbs/Breadcrumbs.svelte'; | ||
import { pageTitle, clientSideToast } from '$lib/utils/stores'; | ||
import { getCookie, deleteCookie } from '$lib/utils/cookies'; | ||
import { browser } from '$app/environment'; | ||
import * as m from '$paraglide/messages'; | ||
let sidebarOpen = true; | ||
$: classesSidebarOpen = (open: boolean) => (open ? 'ml-64' : 'ml-7'); | ||
$: if (browser) { | ||
const fromLogin = getCookie('from_login'); | ||
if (fromLogin === 'true') { | ||
deleteCookie('from_login'); | ||
fetch('/api/waiting-risk-acceptances').then(async (res) => { | ||
const data = await res.json(); | ||
const number = data.count ?? 0; | ||
if (number <= 0) return; | ||
clientSideToast.set({ | ||
message: m.waitingRiskAcceptances({ | ||
number: number, | ||
s: number > 1 ? 's' : '', | ||
itPlural: number > 1 ? 'i' : 'e' | ||
}), | ||
type: 'info' | ||
}); | ||
}); | ||
} | ||
} | ||
</script> | ||
|
||
<!-- App Shell --> | ||
<AppShell | ||
slotPageContent="p-8 bg-gradient-to-br from-violet-100 to-slate-200" | ||
regionPage="transition-all duration-300 {classesSidebarOpen(sidebarOpen)}" | ||
> | ||
<svelte:fragment slot="sidebarLeft"> | ||
<SideBar bind:open={sidebarOpen} /> | ||
</svelte:fragment> | ||
<svelte:fragment slot="pageHeader"> | ||
<AppBar background="bg-white" padding="py-2 px-4"> | ||
<span | ||
class="text-2xl font-bold pb-1 bg-gradient-to-r from-pink-500 to-violet-600 bg-clip-text text-transparent" | ||
id="page-title" | ||
> | ||
{safeTranslate($pageTitle)} | ||
</span> | ||
<hr class="w-screen my-1" /> | ||
<Breadcrumbs /> | ||
</AppBar> | ||
</svelte:fragment> | ||
<!-- Router Slot --> | ||
<slot /> | ||
<!-- ---- / ---- --> | ||
</AppShell> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import type { LayoutServerLoad } from './$types'; | ||
import type { GlobalSettings } from '$lib/utils/types'; | ||
import { BASE_API_URL } from '$lib/utils/constants'; | ||
|
||
export const load: LayoutServerLoad = async ({ fetch, locals }) => { | ||
let clientSettings: GlobalSettings; | ||
if (!locals.globalSettings) { | ||
const _settings = await fetch('/settings/client-settings').then((res) => res.json()); | ||
clientSettings = { name: 'clientSettings', settings: _settings }; | ||
} else clientSettings = locals.globalSettings; | ||
return { featureFlags: locals.featureFlags, clientSettings }; | ||
const licenseStatus = await fetch(`${BASE_API_URL}/license-status/`).then(res => res.json()) | ||
return { featureFlags: locals.featureFlags, clientSettings, licenseStatus }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters