front-back integrated

This commit is contained in:
2026-09-30 02:25:03 +03:00
parent 93ca76c6e1
commit 1f81632083
13 changed files with 298 additions and 27 deletions
+25 -6
View File
@@ -112,6 +112,12 @@ export function _renderRefExercises() {
if (a.workoutType !== b.workoutType) return (a.workoutType || '').localeCompare(b.workoutType || '');
return a.name.localeCompare(b.name);
});
// Генерируем опции для select динамически из state.workoutTypes
const typeOptions = state.workoutTypes.map(wt =>
`<option value="${wt.name}" ${a => a.workoutType === wt.name ? 'selected' : ''}>${wt.name}</option>`
).join('');
list.innerHTML = sorted.map(ex => {
let count = 0;
state.workouts.forEach(w => {
@@ -130,12 +136,7 @@ export function _renderRefExercises() {
<select onchange="SettingsLogic.updateRefExerciseType('${ex.id}', this.value)"
style="width:auto; min-width:100px; padding:6px; font-size:0.8rem;">
<option value="">тип...</option>
<option value="грудь-руки" ${ex.workoutType==='грудь-руки'?'selected':''}>грудь-руки</option>
<option value="ноги" ${ex.workoutType==='ноги'?'selected':''}>ноги</option>
<option value="спина-плечи" ${ex.workoutType==='спина-плечи'?'selected':''}>спина-плечи</option>
<option value="круговая" ${ex.workoutType==='круговая'?'selected':''}>круговая</option>
<option value="силовая" ${ex.workoutType==='силовая'?'selected':''}>силовая</option>
<option value="многоповторная" ${ex.workoutType==='многоповторная'?'selected':''}>многоповторная</option>
${state.workoutTypes.map(wt => `<option value="${wt.name}" ${ex.workoutType === wt.name ? 'selected' : ''}>${wt.name}</option>`).join('')}
</select>
<button class="icon-btn" onclick="SettingsLogic.editRefExercise('${ex.id}')">✎</button>
<button class="icon-btn danger" onclick="SettingsLogic.deleteRefExercise('${ex.id}')">✕</button>
@@ -145,6 +146,24 @@ export function _renderRefExercises() {
}).join('');
}
// Добавим отображение типов замеров в настройки (для тренера)
export function _renderMetricTypes() {
const container = document.getElementById('metric-types-list');
if (!container) return;
if (state.metricTypes.length === 0) {
container.innerHTML = '<p class="text-muted text-small">Нет типов замеров</p>';
return;
}
container.innerHTML = state.metricTypes.map(mt => `
<div class="exercise-ref-item">
<div>
<span class="name">${mt.name}</span>
<span class="type-badge">${mt.unit}</span>
</div>
</div>
`).join('');
}
export function _renderBodyMetricsList() {
const list = document.getElementById('body-metrics-list');
if (!list) return;