+ {#if isEditing}
+
+
+
+
+
+
+
+
+
+
+
+
{:else}
-
-
-
{selectedArticle.title}
- {#if isAdmin}
-
- {/if}
+
+
+
{selectedArticle.category || 'General'}
+
+
+ Por {selectedArticle.last_editor}
+ •
+ Actualizado: {new Date(selectedArticle.updated_at).toLocaleDateString()}
+
-
+
+
{#if browser}
{@html renderMarkdown(selectedArticle.content)}
{:else}
@@ -224,11 +320,17 @@
{/if}
- {/if}
-
+
+ {/if}
+
diff --git a/frontend/src/lib/components/keyboard/KeyboardManager.svelte b/frontend/src/lib/components/keyboard/KeyboardManager.svelte
index c27c4017..1e3720b0 100644
--- a/frontend/src/lib/components/keyboard/KeyboardManager.svelte
+++ b/frontend/src/lib/components/keyboard/KeyboardManager.svelte
@@ -5,6 +5,7 @@
import { GLOBAL_NAV } from '$lib/config/shortcuts';
import { shortcutStore, activeShortcutsList } from '$lib/stores/shortcut-store';
import { focusStore, interactionMode } from '$lib/stores/focus-store';
+ import { helpStore } from '$lib/stores/help.svelte';
import ShortcutsHelpModal from './ShortcutsHelpModal.svelte';
let showHelp = $state(false);
@@ -334,6 +335,16 @@
return;
}
+ // 1.5 HELP DRAWER: F12
+ if (key === 'F12') {
+ if (!authenticated) {
+ return;
+ }
+ event.preventDefault();
+ helpStore.toggle();
+ return;
+ }
+
// 2. ESCAPE
if (key === 'Escape') {
if (showHelp) {
diff --git a/frontend/src/lib/components/sidebar/modules.ts b/frontend/src/lib/components/sidebar/modules.ts
index d1b6d33f..d040c051 100644
--- a/frontend/src/lib/components/sidebar/modules.ts
+++ b/frontend/src/lib/components/sidebar/modules.ts
@@ -18,6 +18,7 @@ import {
Ship,
Truck,
Users,
+ Book,
} from '@lucide/svelte';
import { m } from '$lib/i18n/messages';
import { Title } from '../ui/alert';
@@ -571,9 +572,9 @@ export function getSidebarData(): SidebarData {
icon: Settings2,
},
{
- name: m["sidebar.reference_data.ayuda"](),
+ name: "Manuales del Sistema",
url: "/dashboard/help-center",
- icon: Frame,
+ icon: Book,
},
],
};
diff --git a/frontend/src/routes/dashboard/help-center/+page.svelte b/frontend/src/routes/dashboard/help-center/+page.svelte
index af307a74..9141a24f 100644
--- a/frontend/src/routes/dashboard/help-center/+page.svelte
+++ b/frontend/src/routes/dashboard/help-center/+page.svelte
@@ -56,7 +56,7 @@
order: 0
});
- // Derived state: Grouped by Category
+ // Derived state: Grouped by Category with prioritization for Manuals
const groupedArticles = $derived.by(() => {
const filtered = articles
.filter(
@@ -65,7 +65,14 @@
a.content.toLowerCase().includes(searchTerm.toLowerCase()) ||
(a.category || 'General').toLowerCase().includes(searchTerm.toLowerCase())
)
- .sort((a, b) => (a.order || 0) - (b.order || 0)); // Sort by order first
+ .sort((a, b) => {
+ // Prioritize Manuales category
+ const catA = (a.category || 'General').toLowerCase();
+ const catB = (b.category || 'General').toLowerCase();
+ if (catA.includes('manual') && !catB.includes('manual')) return -1;
+ if (!catA.includes('manual') && catB.includes('manual')) return 1;
+ return (a.order || 0) - (b.order || 0);
+ });
const groups: Record
= {};
filtered.forEach((article) => {
diff --git a/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte b/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte
index d8ea7064..f807b354 100644
--- a/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte
+++ b/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte
@@ -21,7 +21,8 @@
FileText,
Video as VideoIcon,
FileCode,
- Upload
+ Upload,
+ HelpCircle
} from 'lucide-svelte';
import { toast } from 'svelte-sonner';
import { marked } from 'marked';
@@ -56,6 +57,8 @@
let file_url = $state('');
let file_size = $state(undefined);
let mime_type = $state('');
+ let context_path = $state('');
+ let tags = $state('');
// Preview State
let showPreview = $state(true);
@@ -88,6 +91,8 @@
file_url = article.file_url || '';
file_size = article.file_size ?? undefined;
mime_type = article.mime_type || '';
+ context_path = article.context_path || '';
+ tags = article.tags || '';
}
} catch (e: any) {
toast.error('Error al cargar artículo: ' + e.message);
@@ -109,7 +114,9 @@
content_type,
file_url,
file_size,
- mime_type
+ mime_type,
+ context_path,
+ tags
};
// Auto-generate slug if missing
@@ -300,6 +307,19 @@