lazyflat/web/templates/bewerbungen.html
EiSiMo abd614604f feat(apply): treat "Inserat offline" as its own outcome
Offline listings are a different class of result from real failures:
they mean "this ad is gone", not "the apply pipeline is broken".

- DB migration 0010 adds flats.offline_at; recent_flats() filters those
  out globally so they drop off every user's Wohnungen list
- _is_offline_result() matches the four known offline/deactivated
  phrases (DE + EN translations)
- On an offline result: mark the flat, reset the failure counter
  instead of incrementing, and skip the apply_fail notification
- Bewerbungen history renders a yellow "offline" chip in place of the
  red "fehlgeschlagen" one

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 09:56:04 +02:00

42 lines
2.4 KiB
HTML

{% extends "_layout.html" %}
{% block content %}
<section class="card">
<div class="flex items-center justify-between px-4 py-3 border-b border-soft">
<h2 class="font-semibold">Meine Bewerbungen</h2>
<span class="text-xs text-slate-500">{{ applications|length }}</span>
</div>
<div class="divide-y divide-soft">
{% for a in applications %}
<div class="px-4 py-3 text-sm flex flex-col md:flex-row md:items-center gap-3">
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2 flex-wrap">
{% if a.success == 1 %}<span class="chip chip-ok">ok</span>
{% elif a.success == 0 %}
{% set msg_lower = (a.message or '')|lower %}
{% if 'inserat offline' in msg_lower or 'inserat deaktiviert' in msg_lower
or 'ad offline' in msg_lower or 'ad deactivated' in msg_lower %}
<span class="chip chip-warn">offline</span>
{% else %}
<span class="chip chip-bad">fehlgeschlagen</span>
{% endif %}
{% else %}<span class="chip chip-warn">läuft</span>{% endif %}
<span class="chip chip-info">{% if a.triggered_by == 'auto' %}automatisch{% else %}manuell{% endif %}</span>
{% if a.provider %}<span class="chip chip-info">{{ a.provider }}</span>{% endif %}
{% if a.submit_forms_used %}<span class="chip chip-warn">echt gesendet</span>
{% else %}<span class="chip chip-info">nicht abgeschickt</span>{% endif %}
<span class="text-slate-500 text-xs ml-auto"
title="{{ a.started_at|de_dt }}">{{ a.started_at|de_dt }}</span>
</div>
<div class="mt-1 truncate">
#{{ a.id }} — <a href="{{ a.url }}" target="_blank" rel="noopener">{{ a.address or a.url }}</a>
</div>
{% if a.message %}<div class="text-xs text-slate-500 mt-0.5 truncate">{{ a.message }}</div>{% endif %}
</div>
<a class="btn btn-ghost text-sm" href="/bewerbungen/{{ a.id }}/report.zip">Report (ZIP)</a>
</div>
{% else %}
<div class="px-4 py-8 text-center text-slate-500">Noch keine Bewerbungen.</div>
{% endfor %}
</div>
</section>
{% endblock %}