v4.1.0: DMS email documents, category-specific Nachweis linking, version system
- Save cover email body as DMS document with new 'email' context type - Show email body separately from attachments in email detail view - Add per-category DMS document assignment in quarterly confirmation (Studiennachweis, Einkommenssituation, Vermögenssituation) - Add VERSION file and context processor for automatic version display - Add MCP server, agent system, import/export, and new migrations - Update compose files and production environment template Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -247,6 +247,12 @@
|
||||
<span>Destinatärunterstützungen</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<a href="/admin/stiftung/agentconfig/" class="btn btn-outline-warning w-100" target="_blank">
|
||||
<i class="fas fa-robot d-block mb-2 fa-2x"></i>
|
||||
<span>AI Agent Konfiguration</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<a href="/admin/" class="btn btn-outline-warning w-100" target="_blank">
|
||||
<i class="fas fa-user-shield d-block mb-2 fa-2x"></i>
|
||||
|
||||
208
app/templates/stiftung/csv_import_mapping.html
Normal file
208
app/templates/stiftung/csv_import_mapping.html
Normal file
@@ -0,0 +1,208 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}CSV Import – Feldzuordnung{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="fas fa-columns text-primary"></i> Feldzuordnung: {{ import_label }}</h1>
|
||||
<a href="{% url 'stiftung:import_export_hub' %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left"></i> Zurück
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<i class="fas fa-file-csv"></i>
|
||||
<strong>{{ filename }}</strong> – {{ total_rows }} Datenzeilen erkannt.
|
||||
Ordnen Sie die CSV-Spalten den Datenbankfeldern zu. Nicht zugeordnete Spalten werden übersprungen.
|
||||
</div>
|
||||
|
||||
<form method="post" action="{% url 'stiftung:csv_import_execute' %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<!-- Mapping Table -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-project-diagram"></i> Spalten zuordnen
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 5%;">#</th>
|
||||
<th style="width: 25%;">CSV-Spalte</th>
|
||||
<th style="width: 5%;"></th>
|
||||
<th style="width: 30%;">Zuordnung</th>
|
||||
<th style="width: 35%;">Vorschau</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for col in header_previews %}
|
||||
<tr>
|
||||
<td class="text-muted">{{ forloop.counter }}</td>
|
||||
<td><code>{{ col.header }}</code></td>
|
||||
<td class="text-center text-muted"><i class="fas fa-arrow-right"></i></td>
|
||||
<td>
|
||||
<select name="mapping_{{ forloop.counter0 }}" class="form-select form-select-sm mapping-select"
|
||||
data-col-index="{{ forloop.counter0 }}">
|
||||
<option value="__skip__">– Überspringen –</option>
|
||||
{% for field in model_fields %}
|
||||
<option value="{{ field.1 }}">
|
||||
{{ field.0 }}{% if field.3 %} *{% endif %}
|
||||
({{ field.2 }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<small class="text-muted">{{ col.preview|truncatechars:60 }}</small>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<small class="text-muted">* = Pflichtfeld. Zuordnungen werden automatisch vorgeschlagen und können manuell geändert werden.</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preview Table -->
|
||||
{% if preview_rows %}
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-table"></i> Vorschau (erste {{ preview_rows|length }} Zeilen)
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-striped mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
{% for col in header_previews %}
|
||||
<th><small>{{ col.header }}</small></th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in preview_rows %}
|
||||
<tr>
|
||||
{% for cell in row %}
|
||||
<td><small>{{ cell|truncatechars:40 }}</small></td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Import Mode -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-cog"></i> Import-Modus
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="import_mode" id="mode_skip" value="skip" checked>
|
||||
<label class="form-check-label" for="mode_skip">
|
||||
<strong>Nur neue importieren</strong>
|
||||
<br><small class="text-muted">Bereits vorhandene Einträge werden übersprungen</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="import_mode" id="mode_merge" value="merge">
|
||||
<label class="form-check-label" for="mode_merge">
|
||||
<strong>Zusammenführen</strong>
|
||||
<br><small class="text-muted">Vorhandene Einträge werden mit neuen Daten aktualisiert</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="import_mode" id="mode_create" value="create">
|
||||
<label class="form-check-label" for="mode_create">
|
||||
<strong>Alle neu anlegen</strong>
|
||||
<br><small class="text-muted">Keine Duplikatprüfung, alle Zeilen als neue Einträge</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="{% url 'stiftung:import_export_hub' %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-times"></i> Abbrechen
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary btn-lg">
|
||||
<i class="fas fa-upload"></i> {{ total_rows }} Zeilen importieren
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascript %}
|
||||
<script>
|
||||
// Auto-apply mapping from server
|
||||
const autoMapping = {{ auto_mapping_json|safe }};
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
for (const [colIdx, fieldName] of Object.entries(autoMapping)) {
|
||||
const select = document.querySelector(`select[name="mapping_${colIdx}"]`);
|
||||
if (select) {
|
||||
for (const opt of select.options) {
|
||||
if (opt.value === fieldName) {
|
||||
opt.selected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Highlight duplicate mappings
|
||||
const selects = document.querySelectorAll('.mapping-select');
|
||||
selects.forEach(sel => {
|
||||
sel.addEventListener('change', highlightDuplicates);
|
||||
});
|
||||
highlightDuplicates();
|
||||
});
|
||||
|
||||
function highlightDuplicates() {
|
||||
const selects = document.querySelectorAll('.mapping-select');
|
||||
const valueCount = {};
|
||||
|
||||
selects.forEach(sel => {
|
||||
const val = sel.value;
|
||||
if (val && val !== '__skip__') {
|
||||
valueCount[val] = (valueCount[val] || 0) + 1;
|
||||
}
|
||||
});
|
||||
|
||||
selects.forEach(sel => {
|
||||
const val = sel.value;
|
||||
if (val && val !== '__skip__' && valueCount[val] > 1) {
|
||||
sel.classList.add('is-invalid');
|
||||
} else {
|
||||
sel.classList.remove('is-invalid');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -101,11 +101,43 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# E-Mail-Dokument (Cover-Email als DMS-Dokument) #}
|
||||
{% if email_dokument %}
|
||||
<div class="card mb-4 border-primary">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<i class="fas fa-envelope me-2"></i>E-Mail als Dokument
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ email_dokument.titel }}</strong>
|
||||
<br><small class="text-muted">{{ email_dokument.get_human_size }} · Erstellt {{ email_dokument.erstellt_am|date:"d.m.Y H:i" }}</small>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="{% url 'stiftung:dms_download' email_dokument.pk %}" class="btn btn-outline-primary" title="Herunterladen">
|
||||
<i class="fas fa-download me-1"></i>Herunterladen
|
||||
</a>
|
||||
<a href="{% url 'stiftung:dms_detail' email_dokument.pk %}" class="btn btn-outline-secondary" title="Im DMS anzeigen">
|
||||
<i class="fas fa-external-link-alt me-1"></i>Im DMS
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if anhaenge_dokumente %}
|
||||
<hr class="my-2">
|
||||
<small class="text-muted"><i class="fas fa-paperclip me-1"></i>Diese E-Mail hat {{ anhaenge_dokumente|length }} Anhang/Anhaenge (siehe unten)</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Anhaenge / DMS-Dokumente #}
|
||||
{% if dms_dokumente %}
|
||||
{% if anhaenge_dokumente %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-paperclip me-2"></i>Anhaenge ({{ dms_dokumente|length }})
|
||||
<i class="fas fa-paperclip me-2"></i>Anhaenge ({{ anhaenge_dokumente|length }})
|
||||
{% if email_dokument %}
|
||||
<small class="text-muted ms-2">gehoeren zur obigen E-Mail</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table mb-0">
|
||||
@@ -118,17 +150,22 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dok in dms_dokumente %}
|
||||
{% for dok in anhaenge_dokumente %}
|
||||
<tr>
|
||||
<td>{{ dok.dateiname_original|default:dok.titel }}</td>
|
||||
<td><span class="text-muted small">{{ dok.dateityp|default:"–" }}</span></td>
|
||||
<td><span class="text-muted small">{{ dok.get_human_size }}</span></td>
|
||||
<td>
|
||||
{% if dok.datei %}
|
||||
<a href="{% url 'stiftung:dms_download' dok.pk %}" class="btn btn-sm btn-outline-primary">
|
||||
<i class="fas fa-download me-1"></i>Herunterladen
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="btn-group btn-group-sm">
|
||||
{% if dok.datei %}
|
||||
<a href="{% url 'stiftung:dms_download' dok.pk %}" class="btn btn-outline-primary" title="Herunterladen">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'stiftung:dms_detail' dok.pk %}" class="btn btn-outline-secondary" title="Im DMS anzeigen">
|
||||
<i class="fas fa-external-link-alt"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -136,7 +173,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% elif not email_dokument %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-body text-muted text-center py-3">
|
||||
<i class="fas fa-paperclip me-1"></i>Keine Anhaenge in dieser E-Mail.
|
||||
|
||||
187
app/templates/stiftung/import_export_hub.html
Normal file
187
app/templates/stiftung/import_export_hub.html
Normal file
@@ -0,0 +1,187 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Daten Import & Export - Stiftungsverwaltung{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="fas fa-exchange-alt text-primary"></i> Daten Import & Export</h1>
|
||||
</div>
|
||||
|
||||
<!-- Export Section -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-download"></i> CSV Export
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-muted mb-3">Exportieren Sie beliebige Daten als CSV-Datei (Semikolon-getrennt, UTF-8 mit BOM für Excel-Kompatibilität).</p>
|
||||
<div class="row">
|
||||
{% for et in export_types %}
|
||||
<div class="col-md-4 col-lg-3 mb-3">
|
||||
<div class="card h-100 border">
|
||||
<div class="card-body text-center">
|
||||
<h6 class="card-title">{{ et.label }}</h6>
|
||||
<p class="text-muted small mb-2">{{ et.count }} Datensätze</p>
|
||||
<a href="{% url 'stiftung:csv_export' %}?type={{ et.key }}"
|
||||
class="btn btn-outline-success btn-sm {% if et.count == 0 %}disabled{% endif %}">
|
||||
<i class="fas fa-download"></i> Exportieren
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Section -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-upload"></i> CSV Import
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<p class="text-muted mb-3">Importieren Sie Daten aus CSV-Dateien. Im nächsten Schritt können Sie die Spalten Ihrer CSV-Datei den Datenbankfeldern zuordnen.</p>
|
||||
<form method="post" action="{% url 'stiftung:csv_import_upload' %}" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-md-5 mb-3">
|
||||
<label for="import_type" class="form-label"><strong>Import-Typ</strong></label>
|
||||
<select name="import_type" id="import_type" class="form-select" required>
|
||||
<option value="">Bitte wählen...</option>
|
||||
{% for it in import_types %}
|
||||
<option value="{{ it.key }}">{{ it.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-5 mb-3">
|
||||
<label for="csv_file" class="form-label"><strong>CSV-Datei</strong></label>
|
||||
<input type="file" name="csv_file" id="csv_file" class="form-control" accept=".csv" required>
|
||||
</div>
|
||||
<div class="col-md-2 mb-3 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="fas fa-arrow-right"></i> Weiter
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="alert alert-info mb-0">
|
||||
<h6><i class="fas fa-info-circle"></i> Hinweise</h6>
|
||||
<ul class="small mb-0">
|
||||
<li>Unterstützte Formate: CSV (Komma oder Semikolon)</li>
|
||||
<li>Zeichenkodierung: UTF-8 oder Latin-1</li>
|
||||
<li>Datumsformate: TT.MM.JJJJ oder JJJJ-MM-TT</li>
|
||||
<li>Bestehende Datensätze werden anhand eindeutiger Felder aktualisiert</li>
|
||||
<li>Im nächsten Schritt ordnen Sie CSV-Spalten den Feldern zu</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Imports -->
|
||||
{% if recent_imports %}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-history"></i> Letzte Imports
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-sm">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Typ</th>
|
||||
<th>Dateiname</th>
|
||||
<th>Status</th>
|
||||
<th>Ergebnis</th>
|
||||
<th>Benutzer</th>
|
||||
<th>Datum</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for imp in recent_imports %}
|
||||
<tr>
|
||||
<td><span class="badge bg-primary">{{ imp.get_import_type_display }}</span></td>
|
||||
<td>{{ imp.filename }}</td>
|
||||
<td>
|
||||
{% if imp.status == 'completed' %}
|
||||
<span class="badge bg-success"><i class="fas fa-check"></i> OK</span>
|
||||
{% elif imp.status == 'partial' %}
|
||||
<span class="badge bg-warning"><i class="fas fa-exclamation-triangle"></i> Teilweise</span>
|
||||
{% elif imp.status == 'failed' %}
|
||||
<span class="badge bg-danger"><i class="fas fa-times"></i> Fehler</span>
|
||||
{% elif imp.status == 'processing' %}
|
||||
<span class="badge bg-info"><i class="fas fa-spinner fa-spin"></i> Läuft</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">{{ imp.get_status_display }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if imp.total_rows > 0 %}
|
||||
<small>{{ imp.imported_rows }}/{{ imp.total_rows }} importiert</small>
|
||||
{% if imp.failed_rows > 0 %}
|
||||
<small class="text-danger">({{ imp.failed_rows }} fehlgeschlagen)</small>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<small class="text-muted">-</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><small>{{ imp.created_by|default:"-" }}</small></td>
|
||||
<td><small>{{ imp.started_at|date:"d.m.Y H:i" }}</small></td>
|
||||
<td>
|
||||
{% if imp.error_log %}
|
||||
<button type="button" class="btn btn-outline-warning btn-sm"
|
||||
data-bs-toggle="modal" data-bs-target="#errorModal{{ imp.id }}">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{% if imp.error_log %}
|
||||
<div class="modal fade" id="errorModal{{ imp.id }}" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-warning text-dark">
|
||||
<h5 class="modal-title">
|
||||
<i class="fas fa-exclamation-triangle"></i> Fehlerprotokoll – {{ imp.filename }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-info">
|
||||
<strong>{{ imp.imported_rows }}</strong> importiert,
|
||||
<strong>{{ imp.failed_rows }}</strong> fehlgeschlagen
|
||||
von <strong>{{ imp.total_rows }}</strong> Zeilen.
|
||||
</div>
|
||||
<pre class="bg-light p-3 rounded" style="max-height: 400px; overflow-y: auto;"><code>{{ imp.error_log }}</code></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -245,13 +245,35 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-0">
|
||||
<div class="mb-3">
|
||||
<label for="{{ form.studiennachweis_bemerkung.id_for_label }}" class="form-label">{{ form.studiennachweis_bemerkung.label }}</label>
|
||||
{{ form.studiennachweis_bemerkung }}
|
||||
{% if form.studiennachweis_bemerkung.help_text %}
|
||||
<small class="form-text text-muted">{{ form.studiennachweis_bemerkung.help_text }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if alle_dms_dokumente or nachweis.studiennachweis_dms_dokument %}
|
||||
<div class="mb-0">
|
||||
<label class="form-label"><i class="fas fa-folder-open me-1"></i>Oder: DMS-Dokument zuweisen</label>
|
||||
{% if nachweis.studiennachweis_dms_dokument %}
|
||||
<div class="alert alert-success py-2 mb-2">
|
||||
<i class="fas fa-check-circle me-1"></i>
|
||||
<strong>{{ nachweis.studiennachweis_dms_dokument.titel }}</strong>
|
||||
<small class="text-muted">({{ nachweis.studiennachweis_dms_dokument.get_human_size }})</small>
|
||||
<a href="{% url 'stiftung:dms_download' nachweis.studiennachweis_dms_dokument.pk %}" class="ms-2"><i class="fas fa-download"></i></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<select class="form-select form-select-sm" name="studiennachweis_dms_id">
|
||||
<option value="">-- DMS-Dokument waehlen --</option>
|
||||
{% for dok in alle_dms_dokumente %}
|
||||
<option value="{{ dok.pk }}" {% if nachweis.studiennachweis_dms_dokument_id == dok.pk %}selected{% endif %}>
|
||||
{{ dok.titel }} ({{ dok.get_kontext_display }}, {{ dok.get_human_size }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -278,12 +300,12 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-0">
|
||||
<div class="mb-3">
|
||||
<label for="{{ form.einkommenssituation_datei.id_for_label }}" class="form-label">{{ form.einkommenssituation_datei.label }}</label>
|
||||
{{ form.einkommenssituation_datei }}
|
||||
{% if nachweis.einkommenssituation_datei %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">Aktuelle Datei:
|
||||
<small class="text-muted">Aktuelle Datei:
|
||||
<a href="{{ nachweis.einkommenssituation_datei.url }}" target="_blank" class="text-decoration-none">
|
||||
<i class="fas fa-file-pdf text-danger"></i> {{ nachweis.einkommenssituation_datei.name }}
|
||||
</a>
|
||||
@@ -294,6 +316,28 @@
|
||||
<small class="form-text text-muted">{{ form.einkommenssituation_datei.help_text }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if alle_dms_dokumente or nachweis.einkommenssituation_dms_dokument %}
|
||||
<div class="mb-0">
|
||||
<label class="form-label"><i class="fas fa-folder-open me-1"></i>Oder: DMS-Dokument zuweisen</label>
|
||||
{% if nachweis.einkommenssituation_dms_dokument %}
|
||||
<div class="alert alert-success py-2 mb-2">
|
||||
<i class="fas fa-check-circle me-1"></i>
|
||||
<strong>{{ nachweis.einkommenssituation_dms_dokument.titel }}</strong>
|
||||
<small class="text-muted">({{ nachweis.einkommenssituation_dms_dokument.get_human_size }})</small>
|
||||
<a href="{% url 'stiftung:dms_download' nachweis.einkommenssituation_dms_dokument.pk %}" class="ms-2"><i class="fas fa-download"></i></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<select class="form-select form-select-sm" name="einkommenssituation_dms_id">
|
||||
<option value="">-- DMS-Dokument waehlen --</option>
|
||||
{% for dok in alle_dms_dokumente %}
|
||||
<option value="{{ dok.pk }}" {% if nachweis.einkommenssituation_dms_dokument_id == dok.pk %}selected{% endif %}>
|
||||
{{ dok.titel }} ({{ dok.get_kontext_display }}, {{ dok.get_human_size }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -336,6 +380,28 @@
|
||||
<small class="form-text text-muted">{{ form.vermogenssituation_datei.help_text }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if alle_dms_dokumente or nachweis.vermogenssituation_dms_dokument %}
|
||||
<div class="mb-0">
|
||||
<label class="form-label"><i class="fas fa-folder-open me-1"></i>Oder: DMS-Dokument zuweisen</label>
|
||||
{% if nachweis.vermogenssituation_dms_dokument %}
|
||||
<div class="alert alert-success py-2 mb-2">
|
||||
<i class="fas fa-check-circle me-1"></i>
|
||||
<strong>{{ nachweis.vermogenssituation_dms_dokument.titel }}</strong>
|
||||
<small class="text-muted">({{ nachweis.vermogenssituation_dms_dokument.get_human_size }})</small>
|
||||
<a href="{% url 'stiftung:dms_download' nachweis.vermogenssituation_dms_dokument.pk %}" class="ms-2"><i class="fas fa-download"></i></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<select class="form-select form-select-sm" name="vermogenssituation_dms_id">
|
||||
<option value="">-- DMS-Dokument waehlen --</option>
|
||||
{% for dok in alle_dms_dokumente %}
|
||||
<option value="{{ dok.pk }}" {% if nachweis.vermogenssituation_dms_dokument_id == dok.pk %}selected{% endif %}>
|
||||
{{ dok.titel }} ({{ dok.get_kontext_display }}, {{ dok.get_human_size }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -374,6 +440,66 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DMS-Dokumente als Nachweise verknuepfen -->
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-dark text-white">
|
||||
<h5 class="card-title mb-0">
|
||||
<i class="fas fa-folder-open me-2"></i>Dokumente aus dem DMS verknuepfen
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="small text-muted mb-3">
|
||||
Waehlen Sie Dokumente aus dem DMS von {{ destinataer.get_full_name }}, die als Nachweise fuer dieses Quartal dienen sollen.
|
||||
</p>
|
||||
|
||||
{% if verknuepfte_nachweis_dokumente %}
|
||||
<div class="mb-3">
|
||||
<label class="form-label"><strong>Bereits verknuepfte Dokumente:</strong></label>
|
||||
<div class="list-group list-group-flush">
|
||||
{% for dok in verknuepfte_nachweis_dokumente %}
|
||||
<div class="list-group-item d-flex justify-content-between align-items-center px-0">
|
||||
<div>
|
||||
<i class="fas fa-file me-1 text-muted"></i>
|
||||
<strong>{{ dok.titel }}</strong>
|
||||
<span class="badge bg-secondary ms-1">{{ dok.get_kontext_display }}</span>
|
||||
<br><small class="text-muted">{{ dok.dateiname_original }} ({{ dok.get_human_size }})</small>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="{% url 'stiftung:dms_download' dok.pk %}" class="btn btn-outline-primary" title="Herunterladen"><i class="fas fa-download"></i></a>
|
||||
<button type="submit" name="entferne_dms_dokument" value="{{ dok.pk }}" class="btn btn-outline-danger" title="Verknuepfung entfernen">
|
||||
<i class="fas fa-unlink"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if verfuegbare_dms_dokumente %}
|
||||
<div class="mb-0">
|
||||
<label class="form-label"><strong>Verfuegbare Dokumente hinzufuegen:</strong></label>
|
||||
<select class="form-select form-select-sm" name="dms_dokument_hinzufuegen" id="dms_dokument_hinzufuegen">
|
||||
<option value="">-- Dokument aus dem DMS waehlen --</option>
|
||||
{% for dok in verfuegbare_dms_dokumente %}
|
||||
<option value="{{ dok.pk }}">
|
||||
{{ dok.titel }} ({{ dok.get_kontext_display }}, {{ dok.get_human_size }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<small class="form-text text-muted mt-1 d-block">
|
||||
Waehlen Sie ein Dokument und klicken Sie auf "Speichern", um es als Nachweis zu verknuepfen.
|
||||
</small>
|
||||
</div>
|
||||
{% elif not verknuepfte_nachweis_dokumente %}
|
||||
<div class="text-center text-muted py-2">
|
||||
<i class="fas fa-info-circle me-1"></i>Keine DMS-Dokumente fuer {{ destinataer.get_full_name }} vorhanden.
|
||||
<br><small><a href="{% url 'stiftung:dms_upload' %}?destinataer={{ destinataer.pk }}" class="text-decoration-none">Dokument hochladen</a></small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Internal Notes (Staff Only) -->
|
||||
{% if user.is_staff %}
|
||||
<div class="card shadow mb-4">
|
||||
|
||||
Reference in New Issue
Block a user