diff --git a/backend/version.py b/backend/version.py index f20f322..56fa9dc 100644 --- a/backend/version.py +++ b/backend/version.py @@ -1,6 +1,6 @@ # Shinkan Jinkendo Version Information -APP_VERSION = "0.8.72" +APP_VERSION = "0.8.73" BUILD_DATE = "2026-05-10" DB_SCHEMA_VERSION = "20260510047" @@ -30,6 +30,13 @@ MODULE_VERSIONS = { } CHANGELOG = [ + { + "version": "0.8.73", + "date": "2026-05-10", + "changes": [ + "Rechtstexte: PDF-Export via Browser-Print (kein neues Paket); Drucker-Button in AdminLegalDocumentsPage (laedt Volldokument) und auf LegalPage (nur bei veroeffentlichtem Inhalt); Dokument enthaelt Versionsnummer und Gueltigkeitsdatum", + ], + }, { "version": "0.8.72", "date": "2026-05-10", diff --git a/frontend/src/pages/AdminLegalDocumentsPage.jsx b/frontend/src/pages/AdminLegalDocumentsPage.jsx index 87697af..7291ee1 100644 --- a/frontend/src/pages/AdminLegalDocumentsPage.jsx +++ b/frontend/src/pages/AdminLegalDocumentsPage.jsx @@ -1,7 +1,59 @@ import { useState, useEffect, useCallback } from 'react' -import { FileText, Plus, Edit2, Archive, CheckCircle, Clock, Copy } from 'lucide-react' +import { FileText, Plus, Edit2, Archive, CheckCircle, Clock, Copy, Printer } from 'lucide-react' import api from '../utils/api' +function escHtml(str) { + return String(str ?? '') + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') +} + +function printLegalDocument(doc) { + const STATUS_DE = { published: 'Veröffentlicht', draft: 'Entwurf', archived: 'Archiviert' } + const dateStr = doc.published_at + ? new Date(doc.published_at).toLocaleDateString('de-DE') + : new Date(doc.updated_at || doc.created_at).toLocaleDateString('de-DE') + const metaLine = doc.status === 'published' + ? `Version ${doc.version} | Gültig seit ${dateStr}` + : `${STATUS_DE[doc.status] || doc.status} | Version ${doc.version} | Stand ${dateStr}` + + const sectionsHtml = (doc.content_sections || []).map(s => ` +
${escHtml(s.content).replace(/\n/g, '
')}