PDF View i Adminbereich

This commit is contained in:
2026-03-18 17:24:13 +01:00
parent a92694f693
commit 8152aab15b
4 changed files with 599 additions and 0 deletions

View File

@@ -461,6 +461,40 @@
</div>
</div>
</div>
<div class="pdf-archive-section" style="margin-top: 40px;">
<div class="collapsible-header" onclick="togglePdfArchiveSection()" style="cursor: pointer; padding: 15px; background-color: #f5f5f5; border: 1px solid #ddd; border-radius: 4px; display: flex; justify-content: space-between; align-items: center;">
<h2 style="margin: 0;">PDF-Archiv (Timesheets)</h2>
<span id="pdfArchiveToggleIcon" style="font-size: 18px; transition: transform 0.3s;">▼</span>
</div>
<div id="pdfArchiveContent" style="display: none; padding: 20px; border: 1px solid #ddd; border-top: none; border-radius: 0 0 4px 4px; background-color: #fff;">
<div class="form-row" style="display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end;">
<div class="form-group" style="min-width: 180px;">
<label for="pdfYearSelect">Jahr</label>
<select id="pdfYearSelect" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;"></select>
</div>
<div class="form-group" style="min-width: 180px;">
<label for="pdfUserSelect">User</label>
<select id="pdfUserSelect" disabled style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;"></select>
</div>
<div class="form-group" style="min-width: 180px;">
<button id="pdfRefreshBtn" class="btn btn-secondary" type="button" style="width: 100%;">Aktualisieren</button>
</div>
</div>
<div id="pdfArchiveStatus" style="margin-top: 15px; color: #666;"></div>
<div id="pdfFilesContainer" style="margin-top: 15px; overflow-x: auto; max-width: 100%;"></div>
<div id="pdfPreviewContainer" style="display: none; margin-top: 25px;">
<h3 style="margin-top: 0;">Vorschau</h3>
<iframe id="pdfPreviewIframe" style="width: 100%; height: 650px; border: 1px solid #ddd; border-radius: 4px;"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -549,6 +583,20 @@
if (icon) icon.style.transform = 'rotate(0deg)';
}
}
function togglePdfArchiveSection() {
const content = document.getElementById('pdfArchiveContent');
const icon = document.getElementById('pdfArchiveToggleIcon');
if (!content) return;
if (content.style.display === 'none' || content.style.display === '') {
content.style.display = 'block';
if (icon) icon.style.transform = 'rotate(180deg)';
} else {
content.style.display = 'none';
if (icon) icon.style.transform = 'rotate(0deg)';
}
}
// Rollenwechsel-Handler
document.addEventListener('DOMContentLoaded', function() {