|
2 | 2 | import AddBookmarkButton from '$lib/components/AddBookmarkButton/AddBookmarkButton.svelte';
|
3 | 3 | import BookmarkList from '$lib/components/BookmarksList/BookmarkList.svelte';
|
4 | 4 |
|
| 5 | + import { applyAction, enhance } from '$app/forms'; |
5 | 6 | import { page } from '$app/stores';
|
| 7 | + import Pagination from '$lib/components/Pagination/Pagination.svelte'; |
| 8 | + import { user } from '$lib/pb'; |
| 9 | + import { searchEngine, searchedValue } from '$lib/stores/search.store'; |
| 10 | + import { userSettingsStore } from '$lib/stores/user-settings.store'; |
6 | 11 | import type { Bookmark } from '$lib/types/Bookmark.type';
|
| 12 | + import type { UserSettings } from '$lib/types/UserSettings.type'; |
| 13 | + import { initializeSearch } from '$lib/utils/search'; |
| 14 | + import { sortBookmarks } from '$lib/utils/sort-bookmarks'; |
7 | 15 | import {
|
8 | 16 | IconLayout2,
|
9 | 17 | IconListDetails,
|
10 | 18 | IconSortAscending,
|
11 | 19 | IconSortDescending
|
12 | 20 | } from '@tabler/icons-svelte';
|
| 21 | + import _ from 'lodash'; |
13 | 22 | import Select from 'svelte-select';
|
14 |
| - import { sortBookmarks } from '$lib/utils/sort-bookmarks'; |
15 |
| - import { user } from '$lib/pb'; |
16 |
| - import { searchEngine, searchedValue } from '$lib/stores/search.store'; |
17 |
| - import { initializeSearch, searchFactory } from '$lib/utils/search'; |
18 |
| - import Pagination from '$lib/components/Pagination/Pagination.svelte'; |
19 |
| - import { userSettingsStore } from '$lib/stores/user-settings.store'; |
20 |
| - import { applyAction, enhance } from '$app/forms'; |
21 |
| - import type { UserSettings } from '$lib/types/UserSettings.type'; |
22 | 23 | import { writable } from 'svelte/store';
|
23 |
| - import _ from 'lodash'; |
| 24 | + import { PUBLIC_SIGNUP_DISABLED } from '$env/static/public'; |
24 | 25 |
|
25 | 26 | const sortByOptions = [
|
26 | 27 | { label: 'added (desc)', value: 'created_desc' },
|
|
180 | 181 | items={$page.data.bookmarksCount}
|
181 | 182 | position="right"
|
182 | 183 | />
|
| 184 | +{:else if $page.data.noUsersFound} |
| 185 | + <div class="flex flex-col items-center justify-center h-full"> |
| 186 | + <h1 class="text-2xl">Initialization Wizard 🧙</h1> |
| 187 | + <div class="max-w-2xl flex flex-col text-center my-4 gap-2"> |
| 188 | + <p class="text-lg">Looks like you're about to start using Grimoire for the first time!</p> |
| 189 | + {#if PUBLIC_SIGNUP_DISABLED === 'true'} |
| 190 | + <p class="text-lg"> |
| 191 | + Please enable public signup in your <code>.env</code> file and |
| 192 | + <strong><a href="/signup" class="link">create your first User</a></strong> to start using Grimoire. |
| 193 | + </p> |
| 194 | + {:else} |
| 195 | + <p class="text-lg"> |
| 196 | + Please <strong><a href="/signup" class="link">create your first User</a></strong> or check |
| 197 | + out the |
| 198 | + <strong><a href="/admin/login" class="link">Admin Panel</a></strong> (use the credentials |
| 199 | + you set in your |
| 200 | + <code>.env</code> file). |
| 201 | + </p> |
| 202 | + {/if} |
| 203 | + <p class="mt-4"> |
| 204 | + To learn about differences between Admin and User accounts, please check out |
| 205 | + <a href="https://grimoire.pro/docs/admins-vs-users" class="link">this page</a>. |
| 206 | + </p> |
| 207 | + </div> |
| 208 | + </div> |
183 | 209 | {:else}
|
184 | 210 | <div class="flex flex-col items-center justify-center h-full">
|
185 | 211 | <h1 class="text-2xl">Grimoire welcomes!</h1>
|
|
0 commit comments