Add optional per-exercise notes
An exercise instance in a routine only carried sets/reps/weight — a flat target with no room for loading instructions that vary within a session (e.g. a pyramid: "bar only, then +1 plate/side each set"). Adds a small free-text `note` field alongside the existing config flags, shown in the routine editor, during the active workout, and round-tripped through the plan share/print/import paths. No schema migration: it's an optional string on the same object that already carries `sg`/`bodyweight`/`side`.
This commit is contained in:
1 parent
f8024d344d
commit
f52decf633
5 files changed
+21
-6
No files matched your search
@@ -45,6 +45,7 @@ function cleanEx(e) {
|
||||
if (e.repsMin != null) o.repsMin = e.repsMin
|
||||
if (e.repsMax != null) o.repsMax = e.repsMax
|
||||
if (e.sg) o.sg = e.sg
|
||||
if (e.note) o.note = e.note
|
||||
return o
|
||||
}
|
||||
|
||||
@@ -174,7 +175,8 @@ function routineHTML(r, unit) {
|
||||
const ex = EXIDX[e.id]
|
||||
const name = ex ? ex.n : t('Unknown exercise')
|
||||
const part = ex && ex.bp && ex.bp !== 'cardio' ? `<span class="part">${esc(ex.bp)}</span>` : ''
|
||||
return `<div class="ex"><div class="ex-n">${esc(name)}${part}</div><div class="ex-s">${esc(scheme(e, unit))}</div></div>`
|
||||
const note = e.note ? `<div class="ex-note">${esc(e.note)}</div>` : ''
|
||||
return `<div class="ex"><div class="ex-row"><div class="ex-n">${esc(name)}${part}</div><div class="ex-s">${esc(scheme(e, unit))}</div></div>${note}</div>`
|
||||
}).join('')
|
||||
return u.length > 1
|
||||
? `<div class="ss"><div class="ss-tag">${esc(t('Superset'))}</div><div class="ss-items">${items}</div></div>`
|
||||
@@ -236,11 +238,13 @@ export function planPrintHTML(S, owner) {
|
||||
.r-count { font-size: 12px; color: #8a90a0; white-space: nowrap; }
|
||||
|
||||
.ex-list { display: flex; flex-direction: column; }
|
||||
.ex { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 0; break-inside: avoid; page-break-inside: avoid; }
|
||||
.ex { display: flex; flex-direction: column; padding: 6px 0; break-inside: avoid; page-break-inside: avoid; }
|
||||
.ex + .ex, .ss + .ex, .ex + .ss { border-top: 1px solid #f2f3f6; }
|
||||
.ex-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
|
||||
.ex-n { text-transform: capitalize; font-weight: 500; }
|
||||
.ex-n .part { text-transform: capitalize; color: #9aa0ae; font-weight: 400; font-size: 12px; margin-left: 8px; }
|
||||
.ex-s { color: #3d424e; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
||||
.ex-note { color: #6a7080; font-size: 12px; margin-top: 2px; }
|
||||
.ex.empty, .none { color: #a2a8b6; }
|
||||
|
||||
.ss { break-inside: avoid; page-break-inside: avoid; border-left: 3px solid #cfe08a; padding-left: 12px; margin: 4px 0; }
|
||||
|
||||
Reference in new issue
Block a user