All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m54s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m50s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m55s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m18s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m19s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
Der Name „Dokumente“ bleibt dem kommenden QM-Modul (QM-Dokumente und -Formulare) vorbehalten. - Plugin plugins-core/downloads (Inhaus\Plugins\Downloads), Adresse /downloads, Rechte downloads.*, Objekttyp download_folder, Block downloads.folder, Kachel downloads.favorites - Migration für bestehende Installationen: Tabellen und Spalten, Rechte, Sichtbarkeiten, Menü, Startseiten-Anordnung, Blöcke in Seiten und Fassungen, Plugin-Zustand; mit Test - Alte Links unter /dokumente leiten dauerhaft weiter Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
17 lines
666 B
JavaScript
17 lines
666 B
JavaScript
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 Dateien · 2 Ordner“ – leere Teile weglassen. */
|
||
export function folderSummary(folder) {
|
||
const parts = [];
|
||
if (folder.folders) parts.push(entries(folder.folders, 'Ordner', 'Ordner'));
|
||
if (folder.downloads) parts.push(entries(folder.downloads, 'Datei', 'Dateien'));
|
||
|
||
return parts.join(' · ') || 'Noch leer';
|
||
}
|