feat(sources): PDF-Upload auch in der Endkunden-App (Kundenquelle)
- POST /api/sources/upload-pdf: tenant-scoped Upload, gleiche Speicher-
Konvention wie der Verwaltungs-Endpoint (<dirname(DB)>/pdfs/{sha}.pdf).
Duplikat-Check beruecksichtigt globale Quellen.
- dashboard.html: +PDF-Button in der Quellenverwaltungs-Toolbar +
eigenes Modal modal-pdf-upload (closeModal-Quotes via ').
- app.js: App.openPdfUpload + _bindPdfUploadFormOnce (Submit nur einmal
binden).
- api.js: API.upload(path, formData) Helper analog Verwaltung.
Dieser Commit ist enthalten in:
@@ -555,6 +555,7 @@
|
||||
<input type="text" id="sources-search" class="timeline-filter-input sources-search-input" placeholder="Suche..." oninput="App.filterSources()" data-i18n-attr="placeholder:sources_modal.search_placeholder">
|
||||
</div>
|
||||
<div class="sources-toolbar-actions">
|
||||
<button class="btn btn-secondary btn-small" onclick="App.openPdfUpload()" style="margin-right:8px;">+ PDF hochladen</button>
|
||||
<button class="btn btn-primary btn-small" onclick="App.toggleSourceForm()" data-i18n="sources_modal.add_source">+ Quelle</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -633,6 +634,57 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal: PDF als Quelle hochladen -->
|
||||
<div class="modal-overlay" id="modal-pdf-upload" role="dialog" aria-modal="true" aria-labelledby="modal-pdf-upload-title">
|
||||
<div class="modal">
|
||||
<div class="modal-header">
|
||||
<div class="modal-title" id="modal-pdf-upload-title">PDF als Quelle hochladen</div>
|
||||
<button class="modal-close" onclick="closeModal('modal-pdf-upload')" aria-label="Schliessen">×</button>
|
||||
</div>
|
||||
<form id="pdf-upload-form" enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<p class="text-secondary" style="margin-top:0;">
|
||||
Die PDF wird gespeichert und im Hintergrund verarbeitet: Text wird extrahiert (OCR-Fallback fuer gescannte Dokumente) und nach Deutsch und Englisch uebersetzt. Sie erscheint danach in Ihrer Quellenliste.
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label for="pdf-upload-file">PDF-Datei (max. 50 MB)</label>
|
||||
<input type="file" id="pdf-upload-file" accept="application/pdf,.pdf" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pdf-upload-name">Anzeige-Name (optional)</label>
|
||||
<input type="text" id="pdf-upload-name" maxlength="200" placeholder="leer = Dateiname">
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;">
|
||||
<div class="form-group">
|
||||
<label for="pdf-upload-category">Kategorie</label>
|
||||
<select id="pdf-upload-category">
|
||||
<option value="sonstige" selected>Sonstige</option>
|
||||
<option value="behoerde">Behoerde</option>
|
||||
<option value="think-tank">Think-Tank</option>
|
||||
<option value="fachmedien">Fachmedien</option>
|
||||
<option value="international">International</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pdf-upload-language">Sprache (optional)</label>
|
||||
<input type="text" id="pdf-upload-language" placeholder="z.B. Deutsch, Englisch">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pdf-upload-notes">Notizen</label>
|
||||
<input type="text" id="pdf-upload-notes" placeholder="Optional">
|
||||
</div>
|
||||
<div id="pdf-upload-error" class="error-msg" style="display:none"></div>
|
||||
<div id="pdf-upload-progress" class="text-secondary" style="display:none;margin-top:8px;">Laedt hoch …</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" onclick="closeModal('modal-pdf-upload')">Abbrechen</button>
|
||||
<button type="submit" class="btn btn-primary" id="pdf-upload-submit">Hochladen</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal: Content-Viewer (wiederverwendbar für Lagebild, Faktencheck, Quellenübersicht, Timeline) -->
|
||||
<div class="modal-overlay" id="modal-content-viewer" role="dialog" aria-modal="true" aria-labelledby="content-viewer-title">
|
||||
<div class="modal modal-content-viewer">
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren