- Modal „Bewerbung hinzufügen" lässt sich auf allen Bildschirmgrößen scrollen (nicht nur ≤640px), sonst war Speichern abgeschnitten - Aktionen-Spalte der Bewerbungen von 4.5rem auf 5.5rem (passt zur Cluster-Breite, Icons wandern nicht mehr nach rechts) - Merken-Stern im Compact-Modus ohne Rahmen - E-Mail-Uhrzeiten in Postfach, Bewerbung und Reply-Quote in Europe/Berlin Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
1.9 KiB
Plaintext
25 lines
1.9 KiB
Plaintext
<%
|
|
// Stern-Button zum Merken/Entmerken. Generisch einsetzbar für Jobangebote
|
|
// (Standard-Endpunkt /jobangebote/:id/favorit) und Bewerbungen — dann `endpoint`
|
|
// mitgeben. Entweder `j` (legacy, braucht id + favorit) oder direkt `id`/`favorit`.
|
|
// Zustand wird über die Klasse .is-fav gesteuert (definiert in favorit-script).
|
|
// Mit `compact` wird ein reines Icon-Button (für Listenzeilen). Das Skript aus
|
|
// partials/favorit-script bedient Klicks per Delegation — nur einmal pro Seite
|
|
// einbinden.
|
|
var favItem = (typeof item !== 'undefined' && item) ? item : (typeof j !== 'undefined' ? j : null);
|
|
var favId = (typeof id !== 'undefined' && id != null) ? id : (favItem && favItem.id);
|
|
var favAktiv = !!(typeof favorit !== 'undefined' ? favorit : (favItem && favItem.favorit));
|
|
var favEndpoint = (typeof endpoint !== 'undefined' && endpoint)
|
|
? endpoint
|
|
: ('/jobangebote/' + encodeURIComponent(favId) + '/favorit');
|
|
var favCompact = !!(typeof compact !== 'undefined' && compact);
|
|
%>
|
|
<button type="button" class="fav-star<%= favAktiv ? ' is-fav' : '' %> inline-flex items-center justify-center gap-1.5 rounded-md <%= favCompact ? 'p-1' : 'px-3 py-1.5 border' %> text-xs font-medium transition-colors"
|
|
data-favorit="<%= favId %>" data-aktiv="<%= favAktiv ? 1 : 0 %>" data-endpoint="<%= favEndpoint %>"
|
|
title="<%= favAktiv ? 'Favorit entfernen' : 'Als Favorit merken' %>"
|
|
aria-pressed="<%= favAktiv ? 'true' : 'false' %>">
|
|
<svg class="fav-ico h-4 w-4" viewBox="0 0 24 24" fill="<%= favAktiv ? 'currentColor' : 'none' %>" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.5l2.6 5.27 5.82.85-4.21 4.1.99 5.79-5.2-2.73-5.2 2.73.99-5.79-4.21-4.1 5.82-.85 2.6-5.27z"/>
|
|
</svg>
|
|
<% if (!favCompact) { %><span class="fav-label"><%= favAktiv ? 'Gemerkt' : 'Merken' %></span><% } else { %><span class="fav-label hidden"><%= favAktiv ? 'Gemerkt' : 'Merken' %></span><% } %>
|
|
</button> |