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
+31 -1
View File
@@ -233,7 +233,37 @@
<textarea name="llm_notizen" rows="4"
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-800 dark:text-white leading-relaxed"
placeholder="z. B.&#10;Musterfirma GmbH&#10;Musterstraße 12&#10;45128 Essen&#10;Ansprechpartner: Frau Müller"><%= application.llm_notizen || '' %></textarea>
<div class="flex justify-end mt-3">
<!-- Optional extra attachments to enclose (none by default). -->
<div class="mt-4">
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Zusätzliche Anlagen</label>
<% if (basisAnhaenge && basisAnhaenge.length) { %>
<p class="text-xs text-gray-500 dark:text-gray-400 mb-2">
Wähle aus, welche Anlagen (z. B. Zeugnisse) mitgeschickt werden. Standardmäßig
ist nichts ausgewählt; die Auswahl wird auch im Anschreiben unter „Anlagen“ berücksichtigt.
</p>
<div class="space-y-1.5">
<% basisAnhaenge.forEach(function(ba){ %>
<label class="flex items-center gap-2 text-sm text-gray-700 dark:text-gray-200">
<input type="checkbox" name="anlage" value="<%= ba.id %>"
class="rounded border-gray-300 dark:border-gray-600 text-blue-600">
<%= ba.name || ba.dateiname %>
<% if (ba.name && ba.dateiname && ba.name !== ba.dateiname) { %>
<span class="text-xs text-gray-400">(<%= ba.dateiname %>)</span>
<% } %>
</label>
<% }); %>
</div>
<% } else { %>
<p class="text-xs text-gray-400 dark:text-gray-500">
Keine zusätzlichen Anlagen hinterlegt. Unter
<a href="/vorlagen" class="text-blue-600 dark:text-blue-400 hover:underline">Vorlagen</a>
kannst du statische Anlagen (z. B. Zeugnisse) hochladen.
</p>
<% } %>
</div>
<div class="flex justify-end mt-4">
<button type="submit" <%= genStatus === 'ausstehend' ? 'disabled' : '' %>
class="inline-flex items-center gap-1.5 px-4 py-2 text-sm bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white rounded-md transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">