mirror of
https://github.com/karatektus/pl_mail.git
synced 2026-10-25 10:04:18 +00:00
Settings → Mail → Disposal has one per-user switch, off until somebody turns it on. It decides whether Delete forever exists at all: the flame on a row in Spam and the bin, and a new Delete forever above a selection there. Both purge routes answer 403 while the switch is off. A selection extended with Select all N empties the whole of Spam or the bin in a background job. Any other view is refused, and the worker checks the switch and each conversation's placement again. The bin no longer offers Delete above a selection: it trashed mail that was already in the bin, took the rows off the page and they were back on the next load. The choice lives in the user's settings bag and a config backup carries it. No migration. Continues #56. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
2.5 KiB
Twig
52 lines
2.5 KiB
Twig
{#
|
|
settings/_disposal.html.twig
|
|
─────────────────────────────────────────────────────────────────────────────
|
|
Whether the buttons that delete mail for good are offered: the flame on a row
|
|
in Spam and the bin, and the same button above a selection there.
|
|
|
|
A plain form that submits on change and redirects, like the cards beside it:
|
|
the switch decides what the NEXT list draws, so there is nothing on this page
|
|
worth streaming back.
|
|
|
|
Off to begin with, and the card says why: it is the one action in plMail that
|
|
cannot be undone. The hint names both places so nobody has to find the second
|
|
one by accident.
|
|
|
|
Accepts:
|
|
deleteNow bool
|
|
#}
|
|
{% set segText = 'flex h-full items-center justify-center px-3 py-1.5 text-center text-[11px] leading-tight text-ink-muted
|
|
peer-checked:bg-accent peer-checked:text-accent-ink
|
|
peer-focus-visible:ring-2 peer-focus-visible:ring-inset peer-focus-visible:ring-accent
|
|
transition-colors cursor-pointer' %}
|
|
|
|
<div class="px-4 py-3">
|
|
|
|
<form method="post" action="{{ path('app_settings_disposal_update') }}" data-turbo="false" data-controller="ui--auto-submit">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('settings-disposal') }}">
|
|
|
|
<div class="flex items-start justify-between gap-3">
|
|
<span class="min-w-0">
|
|
<span class="block text-xs font-medium text-ink-muted">{{ 'settings.disposal.delete_now'|trans }}</span>
|
|
<span class="block text-[11px] text-ink-faint mt-0.5">{{ 'settings.disposal.delete_now_hint'|trans }}</span>
|
|
</span>
|
|
|
|
<div class="grid grid-flow-col auto-cols-fr shrink-0 rounded-pane border border-line overflow-hidden"
|
|
role="radiogroup" aria-label="{{ 'settings.disposal.delete_now'|trans }}">
|
|
{% for on in [true, false] %}
|
|
<label>
|
|
<input type="radio" name="deleteNow" class="peer sr-only"
|
|
value="{{ on ? '1' : '0' }}"
|
|
data-action="change->ui--auto-submit#submit"
|
|
{{ deleteNow == on ? 'checked' : '' }}>
|
|
<span class="{{ segText }}">
|
|
{{ (on ? 'settings.disposal.on' : 'settings.disposal.off')|trans }}
|
|
</span>
|
|
</label>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|