Let job offers carry a full description into AI generation

Job offers can now be edited in the UI — a large description textarea
(any length) plus the other fields — so a full job posting can be pasted
before turning it into an application. Taking an offer over copies its
complete description into the application's stellenbeschreibung, which is
exactly the text handed to the LLM.

New primary action "Übernehmen & KI-Unterlagen" creates the application
and immediately starts generation; "Nur als Entwurf" keeps the plain
draft path. New routes: POST /jobangebote/:id/bearbeiten and
/jobangebote/:id/uebernehmen-generieren.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 14:07:30 +02:00
co-authored by Claude Opus 4.8
parent dae077486f
commit bc112e2627
2 changed files with 162 additions and 44 deletions
+59 -3
View File
@@ -120,12 +120,20 @@
Zur Bewerbung
</a>
<% } else { %>
<form action="/jobangebote/<%= j.id %>/uebernehmen" method="POST">
<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="Aus diesem Angebot eine Bewerbung (Entwurf) anlegen">
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)">
<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>
Als Bewerbung übernehmen
Nur als Entwurf
</button>
</form>
<% } %>
@@ -139,6 +147,54 @@
</form>
</div>
</div>
<!-- Edit form: paste/adjust the full job description (any length). -->
<details class="mt-3 border-t border-gray-200 dark:border-gray-600 pt-3">
<summary class="cursor-pointer inline-flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400 hover:underline select-none">
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>
Beschreibung / Details bearbeiten
</summary>
<form action="/jobangebote/<%= j.id %>/bearbeiten" method="POST" class="mt-3 space-y-3">
<div class="grid gap-3 sm:grid-cols-2">
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Firma</span>
<input name="firma" value="<%= j.firma %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Stelle</span>
<input name="stelle" value="<%= j.stelle %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Ort</span>
<input name="ort" value="<%= j.ort || '' %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Gehalt</span>
<input name="gehalt" value="<%= j.gehalt || '' %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Kontakt-E-Mail</span>
<input name="kontakt_email" type="email" value="<%= j.kontakt_email || '' %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Anzeige-Datum</span>
<input name="anzeige_datum" type="date" value="<%= j.anzeige_datum ? new Date(j.anzeige_datum).toISOString().split('T')[0] : '' %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
<label class="block text-xs sm:col-span-2">
<span class="text-gray-500 dark:text-gray-400">Quelle-URL</span>
<input name="quelle_url" value="<%= j.quelle_url || '' %>" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-2 py-1.5 text-sm">
</label>
</div>
<label class="block text-xs">
<span class="text-gray-500 dark:text-gray-400">Stellenbeschreibung <span class="text-gray-400">(beliebig lang — wird bei „Übernehmen“ als Stellenbeschreibung für die KI mitgenommen)</span></span>
<textarea name="beschreibung" rows="10" class="mt-1 w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 px-3 py-2 text-sm leading-relaxed" placeholder="Vollständige Stellenbeschreibung hier einfügen …"><%= j.beschreibung || '' %></textarea>
</label>
<button type="submit" class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs bg-blue-600 hover:bg-blue-700 text-white rounded-md transition-colors">
<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 13l4 4L19 7"></path></svg>
Speichern
</button>
</form>
</details>
</li>
<% }); %>
</ul>