feat: update version to 0.7.9 and enhance exercise variant management
- Incremented application version to 0.7.9 and updated changelog to reflect new features. - Added support for creating, updating, and deleting exercise variants via new API endpoints. - Implemented functionality for reordering exercise variants, improving user experience in managing exercise options. - Enhanced frontend components to display and manage exercise variants, including detailed information and editing capabilities.
This commit is contained in:
1 parent
cf9f95377c
commit
1ee1a2f2d9
5 files changed
+837
-26
No files matched your search
@@ -263,24 +263,55 @@ function ExerciseDetailPage() {
|
||||
{(exercise.variants || []).length > 0 && (
|
||||
<section className="card exercise-detail-section">
|
||||
<h2>Varianten</h2>
|
||||
{exercise.variants.map((v) => (
|
||||
<div
|
||||
key={v.id}
|
||||
style={{
|
||||
marginBottom: '1rem',
|
||||
paddingBottom: '1rem',
|
||||
borderBottom: '1px solid var(--border)',
|
||||
}}
|
||||
>
|
||||
<strong style={{ fontSize: '15px' }}>{v.variant_name}</strong>
|
||||
{v.description && <p style={{ color: 'var(--text2)', marginTop: '4px' }}>{v.description}</p>}
|
||||
{v.execution_changes && (
|
||||
<div style={{ marginTop: '8px' }}>
|
||||
<HtmlBlock html={v.execution_changes} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
{exercise.variants.map((v) => {
|
||||
const dur =
|
||||
v.duration_min != null || v.duration_max != null
|
||||
? v.duration_min != null && v.duration_max != null && v.duration_min !== v.duration_max
|
||||
? `${v.duration_min}–${v.duration_max} Min.`
|
||||
: v.duration_min != null
|
||||
? `ca. ${v.duration_min} Min.`
|
||||
: `bis ca. ${v.duration_max} Min.`
|
||||
: null
|
||||
const diffLabel =
|
||||
v.difficulty_adjustment === 'easier'
|
||||
? 'einfacher'
|
||||
: v.difficulty_adjustment === 'harder'
|
||||
? 'schwerer'
|
||||
: v.difficulty_adjustment === 'same'
|
||||
? 'gleiche Schwierigkeit'
|
||||
: v.difficulty_adjustment === 'adapted'
|
||||
? 'angepasst'
|
||||
: null
|
||||
const equip =
|
||||
Array.isArray(v.equipment_changes) && v.equipment_changes.length > 0
|
||||
? v.equipment_changes.join(', ')
|
||||
: null
|
||||
return (
|
||||
<div
|
||||
key={v.id}
|
||||
style={{
|
||||
marginBottom: '1rem',
|
||||
paddingBottom: '1rem',
|
||||
borderBottom: '1px solid var(--border)',
|
||||
}}
|
||||
>
|
||||
<strong style={{ fontSize: '15px' }}>{v.variant_name}</strong>
|
||||
{(dur || diffLabel || equip || v.progression_level != null) && (
|
||||
<div style={{ fontSize: '13px', color: 'var(--text3)', marginTop: '4px' }}>
|
||||
{[dur, diffLabel, equip && `Material: ${equip}`, v.progression_level != null && `Progression ${v.progression_level}`]
|
||||
.filter(Boolean)
|
||||
.join(' · ')}
|
||||
</div>
|
||||
)}
|
||||
{v.description && <p style={{ color: 'var(--text2)', marginTop: '4px' }}>{v.description}</p>}
|
||||
{v.execution_changes && (
|
||||
<div style={{ marginTop: '8px' }}>
|
||||
<HtmlBlock html={v.execution_changes} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user