Loheide-eu-mitarbeiterplatt.../plugins-core/documents/resources/js/lib.js
Friederich Loheide ab0384ceb1
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m30s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m34s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m45s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m35s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m42s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m7s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m15s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m8s
Organigramm und Dokumente neu gestaltet
- Organigramm: grafischer Baum (Linien, Zoom, Verschieben) und
  Fokus-Ansicht mit Vorgesetzten, Team und direkt Unterstellten
- Dokumente: Übersicht mit Bereichen und „Zuletzt aktualisiert“,
  sortierbare Dateiliste oder Kacheln (Wahl wird gemerkt)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 13:06:23 +00:00

17 lines
673 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export const formatSize = (bytes) => {
if (!bytes) return '–';
if (bytes >= 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1).replace('.', ',')} MB`;
return `${Math.max(1, Math.round(bytes / 1024))} KB`;
};
export const entries = (n, one, many) => `${n.toLocaleString('de-DE')} ${n === 1 ? one : many}`;
/** „3 Dokumente · 2 Ordner“ – leere Teile weglassen. */
export function folderSummary(folder) {
const parts = [];
if (folder.folders) parts.push(entries(folder.folders, 'Ordner', 'Ordner'));
if (folder.documents) parts.push(entries(folder.documents, 'Dokument', 'Dokumente'));
return parts.join(' · ') || 'Noch leer';
}