feat(WP-0012): Querschnitt — Freigaben, Felder, Feedback, Suche, Tests
Implements all 8 tasks of the final cross-cutting workplan:
- T01: Generisches Freigabe-Modal (freigabe_modal, freigabe_erteilen views + templates)
- T02: Freigaben-Übersicht pro Ausschreibung (freigaben_uebersicht view + template)
- T03: EntityFieldConfig Admin-Interface (/felder/<entity_type>/ with HTMX toggle)
- T04: CustomAttribute-Panel (full CRUD with sort, lazy HTMX load)
- T05: Feedback-Backlog mit Statusverwaltung + feedback_success.html template
- T06: End-to-End-Tests in vergabe_teilnahme/tests/test_e2e.py (8 tests)
- T07: Globale Suche erweitert (Dokumente, Nachweise, Referenzen, Marktbegleiter)
- T08: Alle Migrationen sauber, 68/68 Tests grün, Ruff-Fehler in neuem Code behoben
Bugfix: URL-Namespace-Fehler in Abgabe-Templates (ausschreibungen:nachbetrachtung:abgabe → ausschreibungen:abgabe)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:54:38 +02:00
|
|
|
from django.shortcuts import get_object_or_404, render
|
2026-05-08 14:26:48 +02:00
|
|
|
from django.views.decorators.http import require_GET, require_POST
|
|
|
|
|
|
|
|
|
|
from .models import Feedbackeintrag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@require_GET
|
|
|
|
|
def modal(request):
|
|
|
|
|
return render(request, 'partials/feedback_modal.html')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@require_POST
|
|
|
|
|
def submit(request):
|
|
|
|
|
beschreibung = request.POST.get('beschreibung', '').strip()
|
|
|
|
|
if not beschreibung:
|
|
|
|
|
return render(request, 'partials/feedback_modal.html',
|
|
|
|
|
{'error': 'Beschreibung ist erforderlich.'})
|
|
|
|
|
|
|
|
|
|
entry = Feedbackeintrag(
|
|
|
|
|
titel=request.POST.get('titel', 'Ohne Titel') or 'Ohne Titel',
|
|
|
|
|
beschreibung=beschreibung,
|
|
|
|
|
seite_kontext=request.POST.get('seite_kontext', ''),
|
|
|
|
|
kategorie=request.POST.get('kategorie', 'hinweis'),
|
|
|
|
|
dringlichkeit=request.POST.get('dringlichkeit', 'mittel'),
|
|
|
|
|
)
|
|
|
|
|
ausschreibung_pk = request.POST.get('ausschreibung')
|
|
|
|
|
if ausschreibung_pk:
|
|
|
|
|
try:
|
|
|
|
|
from vergabe_teilnahme.apps.ausschreibungen.models import Ausschreibung
|
|
|
|
|
entry.ausschreibung = Ausschreibung.objects.get(pk=ausschreibung_pk)
|
|
|
|
|
except (Ausschreibung.DoesNotExist, ValueError):
|
|
|
|
|
pass
|
|
|
|
|
if request.user.is_authenticated:
|
|
|
|
|
entry.erfasst_von = request.user
|
|
|
|
|
entry.save()
|
|
|
|
|
|
feat(WP-0012): Querschnitt — Freigaben, Felder, Feedback, Suche, Tests
Implements all 8 tasks of the final cross-cutting workplan:
- T01: Generisches Freigabe-Modal (freigabe_modal, freigabe_erteilen views + templates)
- T02: Freigaben-Übersicht pro Ausschreibung (freigaben_uebersicht view + template)
- T03: EntityFieldConfig Admin-Interface (/felder/<entity_type>/ with HTMX toggle)
- T04: CustomAttribute-Panel (full CRUD with sort, lazy HTMX load)
- T05: Feedback-Backlog mit Statusverwaltung + feedback_success.html template
- T06: End-to-End-Tests in vergabe_teilnahme/tests/test_e2e.py (8 tests)
- T07: Globale Suche erweitert (Dokumente, Nachweise, Referenzen, Marktbegleiter)
- T08: Alle Migrationen sauber, 68/68 Tests grün, Ruff-Fehler in neuem Code behoben
Bugfix: URL-Namespace-Fehler in Abgabe-Templates (ausschreibungen:nachbetrachtung:abgabe → ausschreibungen:abgabe)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:54:38 +02:00
|
|
|
return render(request, 'partials/feedback_success.html', {})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def backlog(request):
|
|
|
|
|
qs = Feedbackeintrag.objects.select_related('erfasst_von', 'ausschreibung').all()
|
|
|
|
|
|
|
|
|
|
status_filter = request.GET.get('status')
|
|
|
|
|
if status_filter:
|
|
|
|
|
qs = qs.filter(status=status_filter)
|
|
|
|
|
|
|
|
|
|
kategorie_filter = request.GET.get('kategorie')
|
|
|
|
|
if kategorie_filter:
|
|
|
|
|
qs = qs.filter(kategorie=kategorie_filter)
|
|
|
|
|
|
|
|
|
|
dringlichkeit_filter = request.GET.get('dringlichkeit')
|
|
|
|
|
if dringlichkeit_filter:
|
|
|
|
|
qs = qs.filter(dringlichkeit=dringlichkeit_filter)
|
|
|
|
|
|
|
|
|
|
ctx = {
|
|
|
|
|
'eintraege': qs,
|
|
|
|
|
'status_choices': Feedbackeintrag.STATUS_CHOICES,
|
|
|
|
|
'kategorie_choices': Feedbackeintrag.KATEGORIE_CHOICES,
|
|
|
|
|
'dringlichkeit_choices': Feedbackeintrag.DRINGLICHKEIT_CHOICES,
|
|
|
|
|
'current_status': status_filter or '',
|
|
|
|
|
'current_kategorie': kategorie_filter or '',
|
|
|
|
|
'current_dringlichkeit': dringlichkeit_filter or '',
|
|
|
|
|
'breadcrumbs': [{'label': 'Feedback-Backlog', 'url': None}],
|
|
|
|
|
}
|
|
|
|
|
return render(request, 'feedback/backlog.html', ctx)
|
|
|
|
|
|
|
|
|
|
|
2026-05-13 23:45:10 +02:00
|
|
|
def _eintrag_ctx(eintrag):
|
|
|
|
|
return {
|
|
|
|
|
'eintrag': eintrag,
|
|
|
|
|
'status_choices': Feedbackeintrag.STATUS_CHOICES,
|
|
|
|
|
'kategorie_choices': Feedbackeintrag.KATEGORIE_CHOICES,
|
|
|
|
|
'dringlichkeit_choices': Feedbackeintrag.DRINGLICHKEIT_CHOICES,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
feat(WP-0012): Querschnitt — Freigaben, Felder, Feedback, Suche, Tests
Implements all 8 tasks of the final cross-cutting workplan:
- T01: Generisches Freigabe-Modal (freigabe_modal, freigabe_erteilen views + templates)
- T02: Freigaben-Übersicht pro Ausschreibung (freigaben_uebersicht view + template)
- T03: EntityFieldConfig Admin-Interface (/felder/<entity_type>/ with HTMX toggle)
- T04: CustomAttribute-Panel (full CRUD with sort, lazy HTMX load)
- T05: Feedback-Backlog mit Statusverwaltung + feedback_success.html template
- T06: End-to-End-Tests in vergabe_teilnahme/tests/test_e2e.py (8 tests)
- T07: Globale Suche erweitert (Dokumente, Nachweise, Referenzen, Marktbegleiter)
- T08: Alle Migrationen sauber, 68/68 Tests grün, Ruff-Fehler in neuem Code behoben
Bugfix: URL-Namespace-Fehler in Abgabe-Templates (ausschreibungen:nachbetrachtung:abgabe → ausschreibungen:abgabe)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:54:38 +02:00
|
|
|
@require_POST
|
2026-05-13 23:45:10 +02:00
|
|
|
def eintrag_bearbeiten(request, pk):
|
feat(WP-0012): Querschnitt — Freigaben, Felder, Feedback, Suche, Tests
Implements all 8 tasks of the final cross-cutting workplan:
- T01: Generisches Freigabe-Modal (freigabe_modal, freigabe_erteilen views + templates)
- T02: Freigaben-Übersicht pro Ausschreibung (freigaben_uebersicht view + template)
- T03: EntityFieldConfig Admin-Interface (/felder/<entity_type>/ with HTMX toggle)
- T04: CustomAttribute-Panel (full CRUD with sort, lazy HTMX load)
- T05: Feedback-Backlog mit Statusverwaltung + feedback_success.html template
- T06: End-to-End-Tests in vergabe_teilnahme/tests/test_e2e.py (8 tests)
- T07: Globale Suche erweitert (Dokumente, Nachweise, Referenzen, Marktbegleiter)
- T08: Alle Migrationen sauber, 68/68 Tests grün, Ruff-Fehler in neuem Code behoben
Bugfix: URL-Namespace-Fehler in Abgabe-Templates (ausschreibungen:nachbetrachtung:abgabe → ausschreibungen:abgabe)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:54:38 +02:00
|
|
|
eintrag = get_object_or_404(Feedbackeintrag, pk=pk)
|
2026-05-13 23:45:10 +02:00
|
|
|
for field, choices in [
|
|
|
|
|
('status', Feedbackeintrag.STATUS_CHOICES),
|
|
|
|
|
('kategorie', Feedbackeintrag.KATEGORIE_CHOICES),
|
|
|
|
|
('dringlichkeit', Feedbackeintrag.DRINGLICHKEIT_CHOICES),
|
|
|
|
|
]:
|
|
|
|
|
val = request.POST.get(field)
|
|
|
|
|
if val and val in dict(choices):
|
|
|
|
|
setattr(eintrag, field, val)
|
|
|
|
|
for field in ('beschreibung', 'bewertung', 'entscheidung'):
|
|
|
|
|
val = request.POST.get(field)
|
|
|
|
|
if val is not None:
|
|
|
|
|
setattr(eintrag, field, val)
|
|
|
|
|
titel = request.POST.get('titel', '').strip()
|
|
|
|
|
if titel:
|
|
|
|
|
eintrag.titel = titel
|
feat(WP-0012): Querschnitt — Freigaben, Felder, Feedback, Suche, Tests
Implements all 8 tasks of the final cross-cutting workplan:
- T01: Generisches Freigabe-Modal (freigabe_modal, freigabe_erteilen views + templates)
- T02: Freigaben-Übersicht pro Ausschreibung (freigaben_uebersicht view + template)
- T03: EntityFieldConfig Admin-Interface (/felder/<entity_type>/ with HTMX toggle)
- T04: CustomAttribute-Panel (full CRUD with sort, lazy HTMX load)
- T05: Feedback-Backlog mit Statusverwaltung + feedback_success.html template
- T06: End-to-End-Tests in vergabe_teilnahme/tests/test_e2e.py (8 tests)
- T07: Globale Suche erweitert (Dokumente, Nachweise, Referenzen, Marktbegleiter)
- T08: Alle Migrationen sauber, 68/68 Tests grün, Ruff-Fehler in neuem Code behoben
Bugfix: URL-Namespace-Fehler in Abgabe-Templates (ausschreibungen:nachbetrachtung:abgabe → ausschreibungen:abgabe)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:54:38 +02:00
|
|
|
eintrag.save()
|
2026-05-13 23:45:10 +02:00
|
|
|
return render(request, 'feedback/partials/eintrag_zeile.html', _eintrag_ctx(eintrag))
|