Signature image in cover letter + fix per-paragraph capitalization

- Only the first body paragraph continues the salutation (lowercase safe
  opener); every following paragraph is a new sentence and is capitalized.
  Handled deterministically so it no longer depends on the model.
- Signature: upload a signature image on the Vorlagen page (preview / replace /
  remove). It is embedded in the cover letter directly under the closing
  salutation, replacing the typed name; falls back to the name when absent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 11:37:03 +02:00
co-authored by Claude Opus 4.8
parent cbdbbc07e3
commit 78128db422
3 changed files with 168 additions and 20 deletions
+34
View File
@@ -183,6 +183,40 @@
</div>
</form>
</section>
<!-- Signature -->
<h2 class="text-xl font-bold text-gray-800 dark:text-white mt-10 mb-2">Unterschrift</h2>
<p class="text-sm text-gray-500 dark:text-gray-400 mb-6">
Lade dein Unterschriftsbild (PNG/JPG, am besten mit transparentem Hintergrund) hoch. Es wird im
Anschreiben direkt unter „Mit freundlichen Grüßen" anstelle des getippten Namens eingefügt.
</p>
<section class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-6">
<% if (hasSignatur) { %>
<div class="flex items-center justify-between gap-4 mb-4">
<div class="rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/40 p-3">
<img src="/unterschrift?t=<%= Date.now() %>" alt="Unterschrift" class="max-h-24 max-w-[240px] object-contain">
</div>
<form action="/unterschrift/delete" method="POST" onsubmit="return confirm('Unterschrift entfernen?');">
<button type="submit" class="text-sm text-red-600 hover:text-red-800 dark:text-red-400 hover:underline">Entfernen</button>
</form>
</div>
<% } else { %>
<p class="text-sm text-gray-500 dark:text-gray-400 mb-4">Noch keine Unterschrift hinterlegt.</p>
<% } %>
<form action="/unterschrift" method="POST" enctype="multipart/form-data"
class="border-t border-gray-200 dark:border-gray-700 pt-4 mt-2 flex flex-wrap items-end gap-3">
<div class="flex-1 min-w-[220px]">
<label class="block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1">Unterschrift-Bild (PNG/JPG)</label>
<input type="file" name="signatur" accept="image/png,image/jpeg" required
class="w-full text-sm text-gray-700 dark:text-gray-300 file:mr-3 file:py-2 file:px-3 file:rounded-md file:border-0 file:bg-blue-600 file:text-white hover:file:bg-blue-700">
</div>
<button type="submit" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-md transition-colors">
<%= hasSignatur ? 'Ersetzen' : 'Hochladen' %>
</button>
</form>
</section>
</main>
<%- include('partials/footer') %>