toats notifications in the web
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user