Sessions: edit form, soft-delete, lazy creation, chat as separate page
- Session click opens edit form (name, description, image, agent) instead of chat
- Chat is now a separate route (#chat/{id}), opened via button
- Sessions created on save, not on click
- Soft-delete for sessions (is_deleted flag)
- Delete button in session form
- Removed title double-click editing from chat
- Card images now square (aspect-ratio: 1)
- New Session as placeholder card
This commit is contained in:
1 parent
449c872296
commit
a90b9427a5
10 files changed
+340
-188
No files matched your search
+31
-3
@@ -27,7 +27,6 @@
|
||||
<section>
|
||||
<div class="section-header">
|
||||
<h2>Sessions</h2>
|
||||
<button id="newSessionBtn">+ Neue Session</button>
|
||||
</div>
|
||||
<div class="card-grid" id="sessionCards"></div>
|
||||
</section>
|
||||
@@ -48,11 +47,39 @@
|
||||
</template>
|
||||
|
||||
<template id="tpl-session">
|
||||
<div class="page session-page">
|
||||
<div class="page session-edit-page">
|
||||
<header class="session-header">
|
||||
<button class="back-btn" data-page="dashboard">←</button>
|
||||
<h1 id="sessionTitle" class="editable-title">Session</h1>
|
||||
<h1 id="sessionPageTitle">Session</h1>
|
||||
<button id="openChatBtn" hidden>Chat öffnen</button>
|
||||
</header>
|
||||
<div class="agent-form">
|
||||
<div class="agent-avatar-section">
|
||||
<div class="agent-avatar-preview" id="sessionImagePreview">?</div>
|
||||
<input type="file" id="sessionImageInput" accept="image/*" hidden>
|
||||
<button id="sessionImageBtn">Bild ändern</button>
|
||||
<button id="sessionImageClearBtn">Entfernen</button>
|
||||
</div>
|
||||
<label>Name</label>
|
||||
<input type="text" id="sessionName" placeholder="Name der Session">
|
||||
<label>Beschreibung</label>
|
||||
<textarea id="sessionDescription" rows="3" placeholder="Beschreibung (optional)"></textarea>
|
||||
<label>Agent</label>
|
||||
<select id="agentSelect"></select>
|
||||
<div class="agent-form-actions">
|
||||
<button id="sessionSaveBtn">Speichern</button>
|
||||
<button id="sessionCancelBtn">Abbrechen</button>
|
||||
<button id="sessionDeleteBtn" class="danger-btn" hidden>Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="tpl-chat">
|
||||
<div class="page session-page">
|
||||
<header class="session-header">
|
||||
<button class="back-btn" id="chatBackBtn">←</button>
|
||||
<h1 id="sessionTitle">Session</h1>
|
||||
<button class="header-btn" id="archiveBtn">Archivieren</button>
|
||||
<div class="toggle">
|
||||
<input type="checkbox" id="showSystem">
|
||||
@@ -127,6 +154,7 @@
|
||||
<script src="js/pages/dashboard.js"></script>
|
||||
<script src="js/pages/agent-page.js"></script>
|
||||
<script src="js/pages/session-page.js"></script>
|
||||
<script src="js/pages/chat-page.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user