Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Add new page for empty categories

Smaug67398c123e23ba74
diff --git a/frontend/components/AppButton.vue b/frontend/components/AppButton.vue
index e481dcf9..c0bf73fa 100644
--- a/frontend/components/AppButton.vue
+++ b/frontend/components/AppButton.vue
@@ -50,6 +50,9 @@ button {
&:hover {
text-decoration: underline;
}
+ cursor: pointer;
+ font-size: 1.1em;
+ margin-top: 20px;
}
.danger {
background: $red;
diff --git a/frontend/pages/dashboard/categories/[id]/index.vue b/frontend/pages/dashboard/categories/[id]/index.vue
index 6fa19866..e542dbaf 100644
--- a/frontend/pages/dashboard/categories/[id]/index.vue
+++ b/frontend/pages/dashboard/categories/[id]/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="document-list">
- <div v-for="document in documents" :key="document.id" class="document-card">
+ <div v-if="documents.length" v-for="document in documents" :key="document.id" class="document-card">
<div>
<header class="document-header">
<i v-html="category?.icon" class="category-icon"></i>
@@ -25,6 +25,14 @@
</div>
</footer>
</div>
+ <div v-else style="width: 100%; height: 100%">
+ <div style="text-align: center; margin: 10vh auto">
+ <h1>No documents found</h1>
+ <img style="max-width: 300px; max-height: 300px" :src="`/empty-${colorMode.value}.png`" />
+ <p>There are no documents in this category</p>
+ <NuxtLink to="/dashboard/docs/new"><AppButton type="link">+ Create new document </AppButton></NuxtLink>
+ </div>
+ </div>
</div>
</template>
@@ -33,6 +41,7 @@ const route = useRoute();
const categoriesStore = useCategoriesStore();
const documentsStore = useDocumentsStore();
const category = computed(() => categoriesStore.getById(route.params.id as string));
+const colorMode = useColorMode();
definePageMeta({
breadcrumb: () => {