fitness: add RPE input to template editor
This commit is contained in:
@@ -410,6 +410,7 @@
|
|||||||
{#each editorExercises as ex, exIdx (exIdx)}
|
{#each editorExercises as ex, exIdx (exIdx)}
|
||||||
{@const exercise = getExerciseById(ex.exerciseId)}
|
{@const exercise = getExerciseById(ex.exerciseId)}
|
||||||
{@const exMetrics = getExerciseMetrics(exercise).filter((/** @type {string} */ m) => m !== 'rpe')}
|
{@const exMetrics = getExerciseMetrics(exercise).filter((/** @type {string} */ m) => m !== 'rpe')}
|
||||||
|
{@const hasRpe = getExerciseMetrics(exercise).includes('rpe')}
|
||||||
<div class="editor-exercise">
|
<div class="editor-exercise">
|
||||||
<div class="editor-ex-header">
|
<div class="editor-ex-header">
|
||||||
<span class="editor-ex-name">{exercise?.name ?? ex.exerciseId}</span>
|
<span class="editor-ex-name">{exercise?.name ?? ex.exerciseId}</span>
|
||||||
@@ -433,6 +434,10 @@
|
|||||||
{#if mIdx > 0}<span class="set-x">×</span>{/if}
|
{#if mIdx > 0}<span class="set-x">×</span>{/if}
|
||||||
<input type="number" inputmode={metric === 'reps' ? 'numeric' : 'decimal'} placeholder={METRIC_LABELS[metric].toLowerCase()} bind:value={set[metric]} />
|
<input type="number" inputmode={metric === 'reps' ? 'numeric' : 'decimal'} placeholder={METRIC_LABELS[metric].toLowerCase()} bind:value={set[metric]} />
|
||||||
{/each}
|
{/each}
|
||||||
|
{#if hasRpe}
|
||||||
|
<span class="set-x">@</span>
|
||||||
|
<input class="rpe-input" type="number" inputmode="numeric" min="1" max="10" placeholder="rpe" bind:value={set.rpe} />
|
||||||
|
{/if}
|
||||||
{#if ex.sets.length > 1}
|
{#if ex.sets.length > 1}
|
||||||
<button class="set-remove" onclick={() => editorRemoveSet(exIdx, setIdx)} aria-label="Remove set"><X size={14} /></button>
|
<button class="set-remove" onclick={() => editorRemoveSet(exIdx, setIdx)} aria-label="Remove set"><X size={14} /></button>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -925,6 +930,9 @@
|
|||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
.rpe-input {
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
.set-remove {
|
.set-remove {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user