Choose enclosed attachments before generating; drop instant-generate

The generate form now lets the user pick which extra attachments
(basis_anhaenge) to enclose — none selected by default. Only the chosen
ones are attached, and their names are passed to the LLM so the cover
letter's "Anlagen" list and wording reflect exactly what is enclosed.

Job offers keep only "Als Bewerbung übernehmen" (draft first); the
"Übernehmen & KI-Unterlagen" button and its route are removed.

REST API: POST /applications/:id/generate accepts an optional `anlagen`
array of attachment IDs (Swagger updated).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 17:36:14 +02:00
co-authored by Claude Opus 4.8
parent 360e04d677
commit 26872ece08
6 changed files with 77 additions and 43 deletions
+3 -11
View File
@@ -143,20 +143,12 @@
Zur Bewerbung
</a>
<% } else { %>
<form action="/jobangebote/<%= j.id %>/uebernehmen-generieren" method="POST">
<button type="submit"
class="inline-flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs bg-green-600 hover:bg-green-700 text-white rounded-md transition-colors w-full"
title="Bewerbung anlegen und sofort KI-Unterlagen (Anschreiben + Lebenslauf) generieren">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"></path></svg>
Übernehmen &amp; KI-Unterlagen
</button>
</form>
<form action="/jobangebote/<%= j.id %>/uebernehmen" method="POST">
<button type="submit"
class="inline-flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors w-full"
title="Nur einen Bewerbungs-Entwurf anlegen (ohne KI-Generierung)">
class="inline-flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs bg-green-600 hover:bg-green-700 text-white rounded-md transition-colors w-full"
title="Aus diesem Angebot einen Bewerbungs-Entwurf anlegen">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg>
Nur als Entwurf
Als Bewerbung übernehmen
</button>
</form>
<% } %>