Files
komp_ac/web/templates/ui/alert_fragment.html
2026-08-14 20:35:37 +02:00

22 lines
1019 B
HTML

{#
Standalone swap target for every form POST — crate::ui::Alert.
Rendered into the page's #submission-status / #login-status div.
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 toast::success(title, message) %}{% endcall %}
{%- else -%}
{% call alert::error(locale, title, message) %}{% endcall %}
{% call dialog::error(locale, title, message) %}{% endcall %}
{%- endif -%}