From 65f12d9efa437507ec512590c77e2a9eaaa04233 Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Sat, 12 Oct 2024 13:04:15 +0100 Subject: [PATCH] New confirm modal library custom made --- apps/home/static/home/js/modals.js | 85 +++++++++++++++++++ apps/home/templates/home/index.html | 5 +- .../home/modals/{confirm.html => modals.html} | 12 +-- 3 files changed, 91 insertions(+), 11 deletions(-) create mode 100644 apps/home/static/home/js/modals.js rename apps/home/templates/home/modals/{confirm.html => modals.html} (72%) diff --git a/apps/home/static/home/js/modals.js b/apps/home/static/home/js/modals.js new file mode 100644 index 0000000..2d6d476 --- /dev/null +++ b/apps/home/static/home/js/modals.js @@ -0,0 +1,85 @@ + +const validateBootstrapStyle = style => { + if (!["danger", "success", "warning", "info", "primary", "secondary"].includes(style)) { + throw new Error(`${style} is not a valid style`); + } + return true; +} + + +const arrayToHtmlList = (array, bold=false) => { + $ul = $("