diff --git a/frontend/src/components/planning/TrainingPlanningPageRoot.jsx b/frontend/src/components/planning/TrainingPlanningPageRoot.jsx
index 266e4f7..5a2680e 100644
--- a/frontend/src/components/planning/TrainingPlanningPageRoot.jsx
+++ b/frontend/src/components/planning/TrainingPlanningPageRoot.jsx
@@ -658,6 +658,29 @@ function TrainingPlanningPageRoot() {
}
}
+ const handleDeletePlanTemplate = useCallback(
+ async (tpl) => {
+ if (!tpl?.id) return
+ const label = (tpl.name || '').trim() || `Vorlage #${tpl.id}`
+ if (
+ !window.confirm(
+ `Trainingsvorlage „${label}“ wirklich löschen? Die Aktion kann nicht rückgängig gemacht werden.`
+ )
+ ) {
+ return
+ }
+ try {
+ await api.deleteTrainingPlanTemplate(tpl.id)
+ setDraftPlanTemplateId((prev) => (String(prev) === String(tpl.id) ? '' : prev))
+ await loadPlanTemplates()
+ toast.success('Vorlage gelöscht.')
+ } catch (err) {
+ toast.error(err.message || 'Löschen fehlgeschlagen')
+ }
+ },
+ [loadPlanTemplates, toast]
+ )
+
const openModuleApplyModal = useCallback(async (placement) => {
setModuleApplyErr('')
setModuleApplySearchQuery('')
@@ -1924,6 +1947,7 @@ function TrainingPlanningPageRoot() {
draftPlanTemplateId={draftPlanTemplateId}
onDraftTemplateSelect={applyTemplateFromSelect}
planTemplates={planTemplates}
+ onDeletePlanTemplate={handleDeletePlanTemplate}
clubDirectory={clubDirectory}
clubDirectoryForCo={clubDirectoryForCo}
planningModalClubId={planningModalClubId}
diff --git a/frontend/src/components/planning/TrainingPlanningUnitFormModal.jsx b/frontend/src/components/planning/TrainingPlanningUnitFormModal.jsx
index eaec781..f119029 100644
--- a/frontend/src/components/planning/TrainingPlanningUnitFormModal.jsx
+++ b/frontend/src/components/planning/TrainingPlanningUnitFormModal.jsx
@@ -18,6 +18,7 @@ export default function TrainingPlanningUnitFormModal({
draftPlanTemplateId,
onDraftTemplateSelect,
planTemplates,
+ onDeletePlanTemplate,
clubDirectory,
clubDirectoryForCo,
planningModalClubId,
@@ -129,6 +130,70 @@ export default function TrainingPlanningUnitFormModal({
)}
+ {planTemplates.length > 0 && typeof onDeletePlanTemplate === 'function' ? (
+
+ Du kannst eigene Vorlagen entfernen. Plattform-Admins dürfen auch fremde Vorlagen löschen. Einheiten, die
+ noch auf eine Vorlage verweisen, behalten ihren Ablauf; die Verknüpfung zur Vorlage wird vom Server
+ entfernt.
+
+ Gespeicherte Vorlagen löschen
+
+
+ {planTemplates.map((t, ti) => {
+ const roleLc = String(user?.role || '').toLowerCase()
+ const isPlatformAdmin = roleLc === 'admin' || roleLc === 'superadmin'
+ const canDel =
+ user &&
+ (isPlatformAdmin || Number(t.created_by) === Number(user.id))
+ return (
+
+