diff --git a/frontend/src/pages/ExerciseDetailPage.jsx b/frontend/src/pages/ExerciseDetailPage.jsx index 9909f5e..3888320 100644 --- a/frontend/src/pages/ExerciseDetailPage.jsx +++ b/frontend/src/pages/ExerciseDetailPage.jsx @@ -3,6 +3,7 @@ import { Link, useNavigate, useParams, useLocation } from 'react-router-dom' import api from '../utils/api' import ExerciseRichTextBlock from '../components/ExerciseRichTextBlock' import ExerciseAttachmentMediaStrip from '../components/ExerciseAttachmentMediaStrip' +import CombinationPlanBracket from '../components/CombinationPlanBracket' import { formatSkillLevelSlug } from '../constants/skillLevels' import { sortCombinationSlotsForDisplay } from '../constants/combinationArchetypes' @@ -51,6 +52,28 @@ function metaParts(exercise) { return parts } +/** Eindeutige Kandidaten-Übungen für Schnellnavigation unter der Klammerdarstellung */ +function flattenCombinationCandidateLinks(slots) { + const rows = [] + const seen = new Set() + sortCombinationSlotsForDisplay(slots || []).forEach((s) => { + const cands = + s.candidates && s.candidates.length + ? s.candidates + : (s.candidate_exercise_ids || []).map((id) => ({ + exercise_id: id, + title: null, + })) + cands.forEach((c) => { + const eid = c.exercise_id + if (eid == null || seen.has(eid)) return + seen.add(eid) + rows.push({ exercise_id: eid, title: (c.title || '').trim() || null }) + }) + }) + return rows +} + function ExerciseDetailPage() { const { id } = useParams() const navigate = useNavigate() @@ -108,6 +131,20 @@ function ExerciseDetailPage() { const meta = metaParts(exercise) const fromExerciseEdit = location.state?.fromExerciseEdit === true + const isCombinationDetail = + (exercise.exercise_kind || '').toLowerCase().trim() === 'combination' && + Array.isArray(exercise.combination_slots) && + exercise.combination_slots.length > 0 + const combinationCandidateLinks = isCombinationDetail + ? flattenCombinationCandidateLinks(exercise.combination_slots) + : [] + const catalogMethodProfileForBracket = + exercise.method_profile && + typeof exercise.method_profile === 'object' && + !Array.isArray(exercise.method_profile) + ? exercise.method_profile + : {} + return (
{meta.join(' · ')}
}
- Archetyp: {String(exercise.method_archetype)}
-
+ Katalog‑Ablauf mit Archetyp, Zeiten und Stationen — dieselbe Darstellung wie in der Planung und Vorschau. +
+