From 9e79a9fd81f5eb575396e920c731c6f81fabbd73 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sat, 24 Jan 2026 21:43:13 +0100 Subject: [PATCH] docs: add confirm_modal_dynamic documentation to components page Added documentation and interactive examples for both confirm_modal and confirm_modal_dynamic macros, showing danger, warning, info variants and dynamic message capabilities. Co-Authored-By: Claude Opus 4.5 --- app/templates/admin/components.html | 189 ++++++++++++++++++++++++++++ static/admin/js/components.js | 6 + 2 files changed, 195 insertions(+) diff --git a/app/templates/admin/components.html b/app/templates/admin/components.html index b98bc6a3..7144b134 100644 --- a/app/templates/admin/components.html +++ b/app/templates/admin/components.html @@ -2479,6 +2479,195 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati + +
+

Confirmation Modal Macros

+

+ Use the confirm_modal and confirm_modal_dynamic macros for styled confirmation dialogs. These support danger, warning, and info variants. +

+ + {# Static Confirm Modal Demo #} +
+
+ + + + +
+ + {# Confirm Modal Demo (Danger) #} + + + {# Confirm Modal Demo (Warning) #} + + + {# Confirm Modal Demo (Info) #} + + + {# Dynamic Confirm Modal Demo #} + +
+ +
+
+

Static Message (confirm_modal):

+ +
+
+

Dynamic Message (confirm_modal_dynamic):

+ +
+
+ +

+ Parameters: id, title, message (or message_var for dynamic), confirm_action, show_var, confirm_text, cancel_text, variant ('danger'|'warning'|'info'), icon +

+
+

Details Modal (Table Layout)

diff --git a/static/admin/js/components.js b/static/admin/js/components.js index 04c65b41..fbd93a44 100644 --- a/static/admin/js/components.js +++ b/static/admin/js/components.js @@ -429,6 +429,12 @@ function adminComponents() { showLogModal: false, exampleLog: null, + // Confirm modal demo state + showConfirmModalDemo: false, + confirmModalVariant: 'danger', + showDynamicConfirmDemo: false, + dynamicItemName: '', + // Example log data for demo showErrorLogDemo() { this.exampleLog = {