diff --git a/config/current.ver b/config/current.ver index e2cac26..b966e81 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.3 \ No newline at end of file +1.2.4 \ No newline at end of file diff --git a/public/assets/js/ui-editor.js b/public/assets/js/ui-editor.js index f8d1f31..c616d84 100644 --- a/public/assets/js/ui-editor.js +++ b/public/assets/js/ui-editor.js @@ -1060,8 +1060,14 @@ export function initEditor() { } } + function isTemplateSection() { + if (current?.section?.is_template) return true; + const slug = (current?.section?.slug || '').toString().toLowerCase(); + return slug === 'emailtemplate'; + } + async function confirmTemplateReferences(actionLabel) { - if (!current?.section?.is_template || !current?.id) return true; + if (!current?.id || !isTemplateSection()) return true; const res = await apiAction('templates.references', { method: 'GET', data: { template_id: current.id } }).catch(() => null); if (!res || res.ok === false) { return confirm(`Referenzen konnten nicht geprüft werden. ${actionLabel} trotzdem?`); diff --git a/public/assets/js/ui-list.js b/public/assets/js/ui-list.js index cd1370c..1c96e39 100644 --- a/public/assets/js/ui-list.js +++ b/public/assets/js/ui-list.js @@ -88,15 +88,21 @@ async function openTemplateManager(item, section) { let versions = []; let activeId = 0; + const isTemplateSection = () => { + if (section?.is_template) return true; + const slug = (section?.slug || '').toString().toLowerCase(); + return slug === 'emailtemplate'; + }; + const fetchTemplateReferences = async () => { - if (!section?.is_template) return null; + if (!isTemplateSection()) return null; const res = await apiAction('templates.references', { method: 'GET', data: { template_id: item.id } }).catch(() => null); if (!res || res.ok === false) return null; return Array.isArray(res?.references) ? res.references : []; }; const confirmTemplateReferences = async (actionLabel) => { - if (!section?.is_template) return true; + if (!isTemplateSection()) return true; const refs = await fetchTemplateReferences(); if (refs === null) { return confirm(`Referenzen konnten nicht geprüft werden. ${actionLabel} trotzdem?`); diff --git a/public/index.php b/public/index.php index 8c146d0..e9f68ba 100644 --- a/public/index.php +++ b/public/index.php @@ -64,7 +64,7 @@ require __DIR__ . '/../partials/structure/layout_start.php'; - +