From 76e81be6bf9791a9d74547d656510ab742f0fd8e Mon Sep 17 00:00:00 2001 From: Eden Kirin Date: Sun, 7 Apr 2024 10:13:41 +0200 Subject: [PATCH] JS alert toasts --- .../main/complex_form/container.html | 3 +++ .../templates/main/components/js_alert.html | 25 +++++++++++++++++++ project/main/templates/main/filter_list.html | 5 ++-- .../main/templates/main/form_validation.html | 3 +++ project/main/templates/main/swap.html | 3 +++ .../templates/main/table_inline_edit.html | 5 ++-- 6 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 project/main/templates/main/components/js_alert.html diff --git a/project/main/templates/main/complex_form/container.html b/project/main/templates/main/complex_form/container.html index 2802ed4..fa770dd 100644 --- a/project/main/templates/main/complex_form/container.html +++ b/project/main/templates/main/complex_form/container.html @@ -1,7 +1,10 @@ {% extends "main/base/layout.html" %} +{% from "main/components/js_alert.html" import no_js_alert %} {% block content %} + {{ no_js_alert() }} +
+{% endmacro %} + +{% macro js_alert(content) %} + +{% endmacro %} + +{% macro js_alert_work_in_progress() %} + {{ js_alert("Work in progress.") }} +{% endmacro %} diff --git a/project/main/templates/main/filter_list.html b/project/main/templates/main/filter_list.html index 8e380d7..5eccfae 100644 --- a/project/main/templates/main/filter_list.html +++ b/project/main/templates/main/filter_list.html @@ -1,8 +1,7 @@ {% extends "main/base/layout.html" %} +{% from "main/components/js_alert.html" import js_alert_work_in_progress %} {% block content %} -

- This is some filter list content bellow. -

+ {{ js_alert_work_in_progress() }} {% endblock %} diff --git a/project/main/templates/main/form_validation.html b/project/main/templates/main/form_validation.html index 55087e7..e5826da 100644 --- a/project/main/templates/main/form_validation.html +++ b/project/main/templates/main/form_validation.html @@ -1,8 +1,11 @@ {% extends "main/base/layout.html" %} {% from "main/components/toast.html" import toast %} +{% from "main/components/js_alert.html" import js_alert %} {% block content %} + {{ js_alert("Just few lines of JavaScript used to pop toast.") }} + {% endmacro %} + {{ no_js_alert() }} + {{ render_btn(title="Initial", cls="btn-outline-secondary", content="initial") }} {{ render_btn(title="Swap to content 1", cls="btn-info", content="info") }} {{ render_btn(title="Swap to content 2", cls="btn-warning", content="warning") }} diff --git a/project/main/templates/main/table_inline_edit.html b/project/main/templates/main/table_inline_edit.html index 83aabf5..5eccfae 100644 --- a/project/main/templates/main/table_inline_edit.html +++ b/project/main/templates/main/table_inline_edit.html @@ -1,8 +1,7 @@ {% extends "main/base/layout.html" %} +{% from "main/components/js_alert.html" import js_alert_work_in_progress %} {% block content %} -

- This is some table inline edit content bellow. -

+ {{ js_alert_work_in_progress() }} {% endblock %}