Zeige den Vorgang in seiner Akte, ordne mehrere Aufgaben einer Frist zu und verwende Logo sowie Favicon aus der Lieferung.
Deploy Development / deploy (push) Successful in 27s
Test Suite / pytest-backend (push) Successful in 1m7s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 8s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-17 14:57:48 +02:00
1 parent 448e9a06ff
commit dc8a9c2db6
41 files changed
+600 -390

No files matched your search

+6 -3
View File
@@ -454,6 +454,7 @@ export function CaseDetail() {
contextValue={id}
onContext={parentTree ? ((next) => { if (next !== id) navigate(`/cases/${next}`); }) : null}
nodes={caseNodes(record, parentTree)}
allLabel="Direkt in dieser Akte"
chapters={chapters}
chapterId={overview ? "" : chapterId}
allCount={(record.bindings || []).length}
@@ -473,7 +474,7 @@ export function CaseDetail() {
<ReadingPane
binding={entry}
context={context}
backLabel={activeChapter?.title || "Alle Inhalte"}
backLabel={activeChapter?.title || "Direkt in dieser Akte"}
onClose={closeEntry}
onReload={load}
canDetach={canEdit}
@@ -530,7 +531,8 @@ export function CaseDetail() {
containerId={id}
onlyChapter={chapterId}
selectedId={entryId}
listTitle={activeChapter ? activeChapter.title : "Alle Inhalte"}
listTitle={activeChapter ? activeChapter.title : "Direkt in dieser Akte"}
context={context}
onOpen={openEntry}
onChange={load}
itemHref={(binding) => {
@@ -567,6 +569,7 @@ export function CaseDetail() {
<AssignMatter caseId={id} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<p className="muted">Dieser Inhalt liegt direkt in der Akte. Er erscheint unter „Direkt in dieser Akte“ und im Überblick, nicht in einem Vorgang.</p>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
<div className="add-choices">
<button type="button" onClick={() => setModal("chapter")}>Kapitel</button>
@@ -585,7 +588,7 @@ export function CaseDetail() {
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide onClose={() => setModal("")}>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
<MailPicker context={context} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "subcase"} title="Unterakte anlegen" onClose={() => setModal("")}>
+1 -1
View File
@@ -62,7 +62,7 @@ export function Login() {
return (
<main className="login">
<section className="card login-card">
<p className="login-mark" aria-hidden="true"><Mark size={72} /></p>
<p className="login-mark"><Mark size={72} /></p>
<p className="eyebrow">Jinkendo</p>
<h1>Tsumugu</h1>
<p className="lead">Akten, Vorgänge und Fristen an einem Ort. Die erste Lieferung organisiert und verfolgt.</p>
+80 -74
View File
@@ -139,8 +139,8 @@ function caseNodes(caseRecord, parentRecord, activeId, contextId) {
}];
}
function loneNodes(record, query) {
const current = {
function placementNodes(record) {
const matter = {
id: record.id,
title: record.title,
kind: record.kind_label || "Vorgang",
@@ -150,22 +150,32 @@ function loneNodes(record, query) {
id: item.id,
title: item.title,
kind: "Teilvorgang",
href: `/matters/${item.id}${query}`,
href: `/matters/${item.id}`,
current: false,
children: [],
})),
};
if (record.parent_matter_id && record.parent_title) {
return [{
id: record.parent_matter_id,
title: record.parent_title,
kind: "Vorgang",
href: `/matters/${record.parent_matter_id}${query}`,
const rooted = record.parent_matter_id && record.parent_title ? [{
id: record.parent_matter_id,
title: record.parent_title,
kind: "Vorgang",
href: `/matters/${record.parent_matter_id}`,
current: false,
children: [matter],
}] : [matter];
const cases = record.placements || [];
if (cases.length < 2) return rooted;
return [
...rooted,
...cases.map((item) => ({
id: item.case_id,
title: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
kind: "Akte",
href: `/matters/${record.id}?context_kind=case&context_id=${item.case_id}`,
current: false,
children: [current],
}];
}
return [current];
children: [],
})),
];
}
function objectTrail(record, query) {
@@ -233,6 +243,16 @@ export function MatterDetail() {
}
}, [record, id, chapterId, params, setParams]);
useEffect(() => {
if (!record || record.id !== id || inherited?.kind === "case") return;
const placements = record.placements || [];
if (placements.length !== 1) return;
const next = new URLSearchParams(params);
next.set("context_kind", "case");
next.set("context_id", placements[0].case_id);
setParams(next, { replace: true });
}, [record, id, inherited?.kind]);
useEffect(() => {
if (inherited?.kind !== "case") {
setCaseTree(null);
@@ -343,7 +363,7 @@ export function MatterDetail() {
label: item.label.replaceAll("Unterakte ", "").replaceAll("Akte ", "").replaceAll(" → ", " / "),
}));
const contextValue = inherited?.kind === "case" ? inherited.id : (contexts.length === 1 ? contexts[0].id : "");
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : loneNodes(record, query);
const nodes = caseTree ? caseNodes(caseTree, parentTree, id, inherited.id) : placementNodes(record);
const links = [
...(record.cross_links || []).map((item) => ({
id: `cross-${item.id}`,
@@ -351,7 +371,7 @@ export function MatterDetail() {
kind: "Querverweis",
href: `/matters/${item.matter_id}${query}`,
})),
...(record.case_links || []).filter((item) => item.case_id !== inherited?.id).map((item) => ({
...(record.case_links || []).filter((item) => inherited?.kind === "case" && item.case_id !== inherited.id).map((item) => ({
id: `case-${item.id}`,
title: item.title,
kind: "Weitere Akte",
@@ -403,7 +423,7 @@ export function MatterDetail() {
>
<header className="workspace-head">
<div>
<Trail items={objectTrail(record, query)} />
<Trail items={record.trail?.length ? record.trail : objectTrail(record, query)} />
<Placements items={record.placements} />
<div className="title-row">
<h1>{record.title}</h1>
@@ -477,7 +497,7 @@ export function MatterDetail() {
) : null}
</Workspace>
<Modal open={modal === "work"} title="Aufgabe oder Frist" onClose={() => setModal("")}>
<WorkForms matterId={id} context={inherited} tasks={record.tasks} onChange={() => { setModal(""); load(); }} />
<WorkForms matterId={id} context={inherited} deadlines={record.deadlines || []} onChange={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "add"} title={`Hinzufügen in ${targetLabel}`} onClose={() => setModal("")}>
<TargetLine label={targetLabel} chapters={record.chapters} chapterId={activeChapter?.id || ""} />
@@ -498,7 +518,7 @@ export function MatterDetail() {
<Modal open={modal === "paperless"} title="Aus Paperless" onClose={() => setModal("")}>
<PaperlessPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide onClose={() => setModal("")}>
<Modal open={modal === "mail"} title="E-Mail verbinden" wide split onClose={() => setModal("")}>
<MailPicker context={rightsContext} placement={placement} chapterId={activeChapter?.id || ""} chapterTitle={activeChapter?.title || ""} targetLabel={targetLabel} onDone={() => { setModal(""); load(); }} />
</Modal>
<Modal open={modal === "submatter"} title="Teilvorgang anlegen" onClose={() => setModal("")}>
@@ -527,14 +547,35 @@ export function MatterDetail() {
);
}
function WorkForms({ matterId, context, tasks, onChange }) {
function WorkForms({ matterId, context, deadlines, onChange }) {
const [taskTitle, setTaskTitle] = useState("");
const [taskDue, setTaskDue] = useState("");
const [deadlineId, setDeadlineId] = useState("");
const [deadlineTitle, setDeadlineTitle] = useState("");
const [deadlineDue, setDeadlineDue] = useState("");
const [linkTask, setLinkTask] = useState("");
const [error, setError] = useState("");
async function addDeadline(event) {
event.preventDefault();
setError("");
try {
await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
setDeadlineTitle("");
setDeadlineDue("");
onChange();
} catch (err) {
setError(err.message);
}
}
async function addTask(event) {
event.preventDefault();
setError("");
@@ -548,53 +589,15 @@ function WorkForms({ matterId, context, tasks, onChange }) {
...(context ? { context } : {}),
},
});
if (linkTask === "new-deadline" && deadlineTitle && deadlineDue) {
const deadline = await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
if (deadlineId) {
await api(`/api/v1/tasks/${task.id}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...(context ? { context } : {}) },
body: { deadline_id: deadlineId, ...(context ? { context } : {}) },
});
setDeadlineTitle("");
setDeadlineDue("");
}
setTaskTitle("");
setTaskDue("");
setLinkTask("");
onChange();
} catch (err) {
setError(err.message);
}
}
async function addDeadline(event) {
event.preventDefault();
setError("");
try {
const deadline = await api("/api/v1/deadlines", {
method: "POST",
body: {
title: deadlineTitle,
due_on: deadlineDue,
matter_id: matterId,
...(context ? { context } : {}),
},
});
if (linkTask && linkTask !== "new-deadline") {
await api(`/api/v1/tasks/${linkTask}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...(context ? { context } : {}) },
});
}
setDeadlineTitle("");
setDeadlineDue("");
setDeadlineId("");
onChange();
} catch (err) {
setError(err.message);
@@ -603,23 +606,26 @@ function WorkForms({ matterId, context, tasks, onChange }) {
return (
<div className="forms">
<form onSubmit={addDeadline} className="stack compact">
<h3>Frist</h3>
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgeblicher Termin" required />
<label>Frist <input type="date" value={deadlineDue} onChange={(event) => setDeadlineDue(event.target.value)} required /></label>
<button type="submit">Frist erfassen</button>
</form>
<form onSubmit={addTask} className="stack compact">
<h3>Aufgabe</h3>
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist zu tun?" required />
<input value={taskTitle} onChange={(event) => setTaskTitle(event.target.value)} placeholder="Was ist vor der Frist zu tun?" required />
<label>Arbeitstermin <input type="date" value={taskDue} onChange={(event) => setTaskDue(event.target.value)} /></label>
<label>
Gehört zur Frist
<select value={deadlineId} onChange={(event) => setDeadlineId(event.target.value)}>
<option value="">Ohne Frist</option>
{deadlines.map((deadline) => (
<option key={deadline.id} value={deadline.id}>{deadline.title}</option>
))}
</select>
</label>
<button type="submit">Aufgabe anlegen</button>
</form>
<form onSubmit={addDeadline} className="stack compact">
<h3>Unabhängige Frist</h3>
<input value={deadlineTitle} onChange={(event) => setDeadlineTitle(event.target.value)} placeholder="Maßgebliche Frist" required />
<label>Frist <input type="date" value={deadlineDue} onChange={(event) => setDeadlineDue(event.target.value)} required /></label>
<select value={linkTask} onChange={(event) => setLinkTask(event.target.value)}>
<option value="">Nicht mit einer Aufgabe verknüpfen</option>
{tasks.map((task) => (
<option key={task.id} value={task.id}>{task.title}</option>
))}
</select>
<button type="submit">Frist erfassen</button>
<ErrorNote error={error} />
</form>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef } from "react";
import { isDirty, markDirty } from "../api.js";
export function Modal({ open, title, onClose, wide = false, children }) {
export function Modal({ open, title, onClose, wide = false, split = false, children }) {
const dialogRef = useRef(null);
const restoreRef = useRef(null);
@@ -33,7 +33,7 @@ export function Modal({ open, title, onClose, wide = false, children }) {
if (!open) return null;
return (
<div className="modal-overlay" onClick={(event) => { if (event.target === event.currentTarget) requestClose(); }}>
<div ref={dialogRef} className={wide ? "modal modal--wide" : "modal"} role="dialog" aria-modal="true" aria-label={title} tabIndex={-1}>
<div ref={dialogRef} className={`modal${wide ? " modal--wide" : ""}${split ? " modal--split" : ""}`} role="dialog" aria-modal="true" aria-label={title} tabIndex={-1}>
<header className="modal__bar">
<h2>{title}</h2>
<button type="button" className="quiet" onClick={requestClose}>Schließen</button>
+6 -2
View File
@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { api } from "../api.js";
import { TargetLine, formatDate } from "./content.jsx";
import { NavIcon } from "./icons.jsx";
import { ErrorNote } from "./widgets.jsx";
export function Sources() {
@@ -231,9 +232,12 @@ function FolderBranch({ node, mailbox, expanded, onToggle, onSelect }) {
</button>
) : <span className="folder-twist" aria-hidden="true" />}
{node.selectable ? (
<button type="button" className="folder-name" aria-current={current ? "true" : undefined} onClick={() => onSelect(node.name)}>{node.label}</button>
<button type="button" className="folder-name" aria-current={current ? "true" : undefined} onClick={() => onSelect(node.name)}>
<NavIcon name="folder" />
<span>{node.label}</span>
</button>
) : (
<span className="folder-name">{node.label}</span>
<span className="folder-name"><NavIcon name="folder" /><span>{node.label}</span></span>
)}
</div>
{node.children.length && open ? (
+169 -34
View File
@@ -165,11 +165,9 @@ function sectionsOf(chapters, bindings) {
}
export function matterOpenHref(item) {
const contexts = item?.contexts || [];
if (contexts.some((entry) => entry.kind === "direct")) return `/matters/${item.id}`;
const context = contexts.find((entry) => entry.kind === "case");
if (!context) return `/matters/${item.id}`;
return `/matters/${item.id}?context_kind=case&context_id=${context.id}`;
const cases = (item?.contexts || []).filter((entry) => entry.kind === "case");
if (cases.length === 1) return `/matters/${item.id}?context_kind=case&context_id=${cases[0].id}`;
return `/matters/${item.id}`;
}
export function Placements({ items }) {
@@ -346,7 +344,25 @@ export function ContentBoard({
const visibleSections = onlyChapter ? sections.filter((section) => section.id === onlyChapter) : sections;
const shownCount = onlyChapter ? (visibleSections[0]?.items.length || 0) : source.length;
const canSort = sortable && record?.rights?.edit;
const canEdit = Boolean(record?.rights?.edit);
const canDestroy = Boolean(record?.is_owner);
const canMoveChapters = Boolean(canSort && chapters.length > 1);
async function removeBinding(binding, everywhere) {
const element = binding.element;
if (everywhere) {
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
} else {
if (!window.confirm("Aus diesem Zusammenhang entfernen? Die Unterlage bleibt an anderen Stellen erhalten.")) return;
const action = context || (containerKind === "case" ? { kind: "case", id: containerId } : { kind: "matter", id: containerId });
const search = new URLSearchParams();
search.set("context_kind", action.kind);
search.set("context_id", action.id);
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
}
onChange();
}
const orderPath = `/api/v1/${containerKind === "case" ? "cases" : "matters"}/${containerId}`;
const orderContext = context && containerKind === "matter" ? { context } : {};
@@ -794,8 +810,15 @@ export function ContentBoard({
<span className="preview-row__origin">Kapitel {(chapters.find((chapter) => chapter.id === binding.chapter_id)?.title) || ""}</span>
) : null}
</Link>
{(canSort && custom) || (canSort && chapters.length) ? (
{(canEdit || (canSort && custom) || (canSort && chapters.length)) ? (
<div className="preview-row__actions">
{canEdit ? (
<details className="row-menu">
<summary>Entfernen</summary>
<button type="button" onClick={() => removeBinding(binding, false)}>Aus diesem Zusammenhang entfernen</button>
{canDestroy ? <button type="button" className="danger" onClick={() => removeBinding(binding, true)}>Überall löschen</button> : null}
</details>
) : null}
{canSort && custom ? (
<details className="row-menu">
<summary>Reihenfolge</summary>
@@ -940,8 +963,27 @@ export function AuditLog({ items, nextCursor, onMore }) {
);
}
function contentChoices(record) {
const rows = [...(record?.bindings || [])];
for (const group of record?.contained || []) rows.push(...(group.bindings || []));
const seen = new Set();
return rows.flatMap((binding) => {
const element = binding.element;
if (!element?.id || seen.has(element.id)) return [];
seen.add(element.id);
return [{ id: element.id, title: element.title }];
});
}
function taskContextBody(task, context) {
const taskContext = task.action_context || context;
return taskContext ? { context: taskContext } : {};
}
export function WorkLists({ record, context, onChange }) {
const linked = new Set((record.task_deadline_links || []).map((item) => item.task_id));
const links = record.task_deadline_links || [];
const tasks = record.tasks || [];
const elements = contentChoices(record);
async function complete(task) {
const body = { expected_version: task.version, status: "done" };
@@ -958,42 +1000,135 @@ export function WorkLists({ record, context, onChange }) {
onChange();
}
const tasksFor = (deadlineId) => tasks.filter((task) => links.some((link) => link.deadline_id === deadlineId && link.task_id === task.id));
const linkedIds = new Set(links.map((link) => link.task_id));
const loose = tasks.filter((task) => !linkedIds.has(task.id));
async function assign(task, deadline) {
await api(`/api/v1/tasks/${task.id}/deadline-links`, {
method: "POST",
body: { deadline_id: deadline.id, ...taskContextBody(task, context) },
});
onChange();
}
return (
<div className="stack">
<p className="muted">Erledigen und Erfüllen bleiben getrennte Aktionen.</p>
<div>
<h3>Aufgaben</h3>
{record.tasks?.length ? (
<ul className="work">
{record.tasks.map((task) => (
<li key={task.id}>
<div>
<strong>{task.title}</strong>
<span>{task.status === "done" ? "Erledigt" : "Offen"}{task.due_on ? ` · ${formatDate(task.due_on)}` : ""}{task.matter_title ? ` · ${task.matter_title}` : ""}</span>
{linked.has(task.id) ? <small>Mit einer Frist verknüpft, ohne sie zu erfüllen.</small> : null}
</div>
{task.status === "open" && task.rights?.edit !== false ? <button type="button" onClick={() => complete(task)}>Erledigen</button> : null}
</li>
))}
</ul>
) : <p className="muted">Keine Aufgabe.</p>}
</div>
<p className="muted">Eine Frist ist der maßgebliche Termin. Mehrere Aufgaben können davor liegen. Erledigen einer Aufgabe erfüllt die Frist nicht.</p>
<div>
<h3>Fristen</h3>
{record.deadlines?.length ? (
<ul className="work">
{record.deadlines.map((deadline) => (
<li key={deadline.id}>
<div>
<strong>{deadline.title}</strong>
<span>{deadline.status === "fulfilled" ? "Erfüllt" : "Offen"} · {formatDate(deadline.due_on)}{deadline.matter_title ? ` · ${deadline.matter_title}` : ""}</span>
</div>
{deadline.status === "open" ? <button type="button" onClick={() => fulfill(deadline)}>Frist erfüllen</button> : null}
</li>
))}
{record.deadlines.map((deadline) => {
const assigned = tasksFor(deadline.id);
const available = tasks.filter((task) => !assigned.some((item) => item.id === task.id));
return (
<li key={deadline.id}>
<div>
<strong>{deadline.title}</strong>
<span>{deadline.status === "fulfilled" ? "Erfüllt" : "Offen"} · {formatDate(deadline.due_on)}{deadline.matter_title ? ` · ${deadline.matter_title}` : ""}</span>
{assigned.length ? (
<ul className="task-under">
{assigned.map((task) => (
<TaskRow key={task.id} task={task} tasks={tasks} elements={elements} context={context} onComplete={complete} onChange={onChange} />
))}
</ul>
) : <small>Noch keine Aufgabe vor dieser Frist.</small>}
{available.length ? (
<label className="task-assign">
Aufgabe zuordnen
<select value="" onChange={(event) => { const task = available.find((item) => item.id === event.target.value); if (task) assign(task, deadline); }}>
<option value="">Auswählen</option>
{available.map((task) => <option key={task.id} value={task.id}>{task.title}</option>)}
</select>
</label>
) : null}
</div>
{deadline.status === "open" ? <button type="button" onClick={() => fulfill(deadline)}>Frist erfüllen</button> : null}
</li>
);
})}
</ul>
) : <p className="muted">Keine Frist.</p>}
</div>
<div>
<h3>Aufgaben ohne Frist</h3>
{loose.length ? (
<ul className="work">
{loose.map((task) => (
<li key={task.id}>
<TaskRow task={task} tasks={tasks} elements={elements} context={context} onComplete={complete} onChange={onChange} />
</li>
))}
</ul>
) : <p className="muted">Keine Aufgabe ohne Frist.</p>}
</div>
</div>
);
}
function TaskRow({ task, tasks, elements, context, onComplete, onChange }) {
const [elementIds, setElementIds] = useState((task.elements || []).map((item) => item.id));
const [dependsOn, setDependsOn] = useState("");
const others = tasks.filter((item) => item.id !== task.id);
async function saveElements(next) {
setElementIds(next);
await api(`/api/v1/tasks/${task.id}/elements`, {
method: "PUT",
body: { element_ids: next, ...taskContextBody(task, context) },
});
onChange();
}
async function addDependency(event) {
const id = event.target.value;
setDependsOn("");
if (!id) return;
await api(`/api/v1/tasks/${task.id}/dependencies`, {
method: "POST",
body: { depends_on_task_id: id, ...taskContextBody(task, context) },
});
onChange();
}
return (
<div className="task-row">
<div>
<strong>{task.title}</strong>
<span>{task.status === "done" ? "Erledigt" : "Offen"}{task.due_on ? ` · Arbeitstermin ${formatDate(task.due_on)}` : ""}</span>
{(task.depends_on || []).length ? <small>Hängt ab von {task.depends_on.map((item) => item.title).join(", ")}.</small> : null}
{(task.elements || []).length ? <small>Bezieht sich auf {task.elements.map((item) => item.title).join(", ")}.</small> : null}
</div>
{task.status === "open" && task.rights?.edit !== false ? <button type="button" onClick={() => onComplete(task)}>Erledigen</button> : null}
{task.rights?.edit !== false ? (
<details className="row-menu">
<summary>Bezüge</summary>
<label>
Hängt ab von
<select value={dependsOn} onChange={addDependency}>
<option value="">Aufgabe wählen</option>
{others.map((item) => <option key={item.id} value={item.id}>{item.title}</option>)}
</select>
</label>
<fieldset className="task-elements">
<legend>Inhalte</legend>
{elements.length ? elements.map((element) => (
<label key={element.id}>
<input
type="checkbox"
checked={elementIds.includes(element.id)}
onChange={(event) => {
const next = event.target.checked ? [...elementIds, element.id] : elementIds.filter((id) => id !== element.id);
saveElements(next);
}}
/>
{element.title}
</label>
)) : <span>In diesem Objekt liegt noch kein Inhalt.</span>}
</fieldset>
</details>
) : null}
</div>
);
}
+9 -9
View File
@@ -26,15 +26,15 @@ export function NavIcon({ name }) {
return <svg {...common}><circle cx="12" cy="12" r="8" /></svg>;
}
import { ENSO_PATH } from "../enso-path.js";
export function Mark({ size = 36 }) {
export function Mark({ size = 40 }) {
return (
<svg className="mark" width={size} height={size} viewBox="0 0 64 64" aria-hidden="true">
<path fill="currentColor" d={ENSO_PATH} />
<path fill="currentColor" opacity="0.72" d="M37.2 25.2h11.2v13.2h-1.8V27.4H38.6z" />
<path fill="currentColor" d="M22.8 29.2h8.8l1.7 2.2h10.2V44H22.8z" />
<path fill="currentColor" opacity="0.45" d="M26.2 34.2h6.4v1.3h-6.4zm0 2.8h4.5v1.3h-4.5z" />
</svg>
<img
className="mark"
src="/brand/logo-original.png"
alt="Tsumugu"
width={280}
height={298}
style={{ height: size, width: "auto" }}
/>
);
}
+41 -38
View File
@@ -95,6 +95,7 @@ export function StructureNavigator({
chapters = [],
chapterId = "",
allCount = 0,
allLabel = "Alle Inhalte",
overview = null,
chapterHeading,
onChapter,
@@ -116,6 +117,7 @@ export function StructureNavigator({
</button>
) : null}
</div>
<div className="structure__tree">
<label className="context-select">
Aktenkontext
<select
@@ -130,44 +132,6 @@ export function StructureNavigator({
</select>
</label>
<TreeNodes nodes={nodes} onNavigate={onNavigate} />
<div className="structure__chapters">
<h3>{chapterHeading}</h3>
{overview ? (
<button type="button" className={overview.active ? "chapter-link is-current" : "chapter-link"} onClick={overview.onSelect}>
<span>Überblick</span>
<span className="count">{overview.count}</span>
</button>
) : null}
<button type="button" className={!chapterId && !overview?.active ? "chapter-link is-current" : "chapter-link"} onClick={() => onChapter("")}>
<span>Alle Inhalte</span>
<span className="count">{allCount}</span>
</button>
<ul className="chapter-links">
{chapters.map((chapter, index) => (
<li key={chapter.id}>
<button
type="button"
className={chapterId === chapter.id ? "chapter-link is-current" : "chapter-link"}
onClick={() => onChapter(chapter.id)}
>
<span>{chapter.title}</span>
<span className="count">{chapter.count}</span>
</button>
{canReorder && chapterId === chapter.id ? (
<span className="chapter-link__move">
<button type="button" aria-label={`${chapter.title} nach oben`} disabled={index === 0} onClick={() => onMoveChapter(chapter.id, -1)}>Nach oben</button>
<button type="button" aria-label={`${chapter.title} nach unten`} disabled={index === chapters.length - 1} onClick={() => onMoveChapter(chapter.id, 1)}>Nach unten</button>
</span>
) : null}
</li>
))}
</ul>
{canAddChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
<NavIcon name="plus" /> Kapitel
</button>
) : null}
</div>
{links.length ? (
<div className="structure__links">
<h3>Weitere Zuordnungen</h3>
@@ -186,6 +150,45 @@ export function StructureNavigator({
</ul>
</div>
) : null}
</div>
<div className="structure__chapters">
<h3>{chapterHeading}</h3>
{overview ? (
<button type="button" className={overview.active ? "chapter-link is-current" : "chapter-link"} onClick={overview.onSelect}>
<span>Überblick</span>
<span className="count">{overview.count}</span>
</button>
) : null}
<button type="button" className={!chapterId && !overview?.active ? "chapter-link is-current" : "chapter-link"} onClick={() => onChapter("")}>
<span>{allLabel}</span>
<span className="count">{allCount}</span>
</button>
<ul className="chapter-links">
{chapters.map((chapter, index) => (
<li key={chapter.id}>
<button
type="button"
className={chapterId === chapter.id ? "chapter-link is-current" : "chapter-link"}
onClick={() => onChapter(chapter.id)}
>
<span>{chapter.title}</span>
<span className="count">{chapter.count}</span>
</button>
{canReorder ? (
<span className="chapter-link__move">
<button type="button" aria-label={`${chapter.title} nach oben`} disabled={index === 0} onClick={() => onMoveChapter(chapter.id, -1)}>↑</button>
<button type="button" aria-label={`${chapter.title} nach unten`} disabled={index === chapters.length - 1} onClick={() => onMoveChapter(chapter.id, 1)}>↓</button>
</span>
) : null}
</li>
))}
</ul>
{canAddChapter ? (
<button type="button" className="quiet chapter-add" onClick={onAddChapter}>
<NavIcon name="plus" /> Kapitel
</button>
) : null}
</div>
</nav>
);
}