toats notifications in the web

This commit is contained in:
Priec
2026-08-07 21:30:32 +02:00
parent 945dd811f4
commit 7cda7ea833
12 changed files with 102 additions and 25 deletions

View File

@@ -2,15 +2,19 @@
Standalone swap target for every form POST — crate::ui::Alert.
Rendered into the page's #submission-status / #login-status div.
A success is an inline alert and nothing more. A failure also gets the
A success is a toast: it floats over the page, says its piece and removes
itself, so it neither pushes the form around nor stays behind as a stale
claim about a draft that has since moved on. A failure is the opposite —
it has to stay until it is read — so it keeps the inline alert, plus the
dialog: these divs sit at the bottom of their form, so on any page long
enough to scroll — the validation forms, the import form, the table builder
— the alert alone lands off screen and the page looks like it did nothing.
#}
{% import "ui/alert.html" as alert %}
{% import "ui/dialog.html" as dialog %}
{% import "ui/toast.html" as toast %}
{%- if success -%}
{% call alert::success(title, message) %}{% endcall %}
{% call toast::success(title, message) %}{% endcall %}
{%- else -%}
{% call alert::error(title, message) %}{% endcall %}
{% call dialog::error(title, message) %}{% endcall %}