added robust Readme.md updated index.html for checkbox, editing for Final Log
This commit is contained in:
parent
3cbaaf82f6
commit
ddd4181394
6 changed files with 122 additions and 208 deletions
111
README.md
111
README.md
|
|
@ -1,4 +1,109 @@
|
||||||
# zed_workouts
|
# Zed Workouts
|
||||||
|
|
||||||
Test a new coding workflow. Want to try and use a local LLM to facilitate coding a django based workout webpage to track and store workouts in MySQL db.
|
A Django-based workout tracking web app optimized for mobile use. Track your gym sessions with template-based exercise generation and automatic history logging.
|
||||||
Implemented qwen2.57b-instruct-q4_K-M with Zed Agent to develop code. Tried some other agents and this is the first one I was able to get to respond with proper tool calls.
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
zed_workouts/
|
||||||
|
├── tracker/
|
||||||
|
│ ├── migrations/ # Database migrations
|
||||||
|
│ ├── templates/tracker/
|
||||||
|
│ │ └── index.html # Main workout tracking UI
|
||||||
|
│ ├── admin.py # Django admin configuration
|
||||||
|
│ ├── apps.py # App configuration
|
||||||
|
│ ├── models.py # Database models
|
||||||
|
│ ├── tests.py # Unit tests
|
||||||
|
│ ├── urls.py # App URL routing
|
||||||
|
│ └── views.py # View controllers
|
||||||
|
└── zed_workouts/
|
||||||
|
├── settings.py # Django settings
|
||||||
|
├── urls.py # Project URL routing
|
||||||
|
└── wsgi.py # WSGI entry point
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
- **Backend**: Django 4.x (Python)
|
||||||
|
- **Frontend**: Vanilla JavaScript + Bootstrap 5
|
||||||
|
- **Database**: SQLite (default, easily swappable)
|
||||||
|
- **Deployment**: Docker
|
||||||
|
|
||||||
|
## Data Models
|
||||||
|
|
||||||
|
### Exercise
|
||||||
|
Stores available exercises with type and group categorization.
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| exercise | CharField | Exercise name (unique) |
|
||||||
|
| type | CharField | Muscle group (Chest, Back, Arms, etc.) |
|
||||||
|
| group | CharField | Priority (Primary, Secondary, Core) |
|
||||||
|
|
||||||
|
### Workout (History)
|
||||||
|
Logs completed workout sets.
|
||||||
|
|
||||||
|
### Template Models
|
||||||
|
Templates for each workout type: `ChestTemplate`, `BackTemplate`, `LegsTemplate`
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|-------|------|-------------|
|
||||||
|
| date | DateField | Auto-set to creation date |
|
||||||
|
| group | CharField | Primary/Secondary/Core |
|
||||||
|
| type | CharField | Muscle group |
|
||||||
|
| exercise | CharField | Exercise name |
|
||||||
|
| set | IntegerField | Set number (1-4) |
|
||||||
|
| weight | DecimalField | Weight lifted |
|
||||||
|
| reps | IntegerField | Repetitions performed |
|
||||||
|
| notes | TextField | Optional notes |
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
1. **Template Selection**: Choose Chest, Back, or Legs workout
|
||||||
|
2. **Exercise Dropdowns**: Primary, Secondary, Core categories
|
||||||
|
3. **Block Generation**: Creates 4 sets per selected exercise
|
||||||
|
4. **Ad-hoc Exercises**: Add individual exercises on the fly
|
||||||
|
5. **Workout Logging**: Saves all completed sets to history
|
||||||
|
6. **Mobile Optimization**: Hides non-essential columns, touch-friendly UI
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Local Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create virtual environment
|
||||||
|
python -m venv .venv
|
||||||
|
source .venv/bin/activate # Linux/Mac
|
||||||
|
# or .venv\Scripts\activate # Windows
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Run migrations
|
||||||
|
cd zed_workouts
|
||||||
|
python manage.py migrate
|
||||||
|
|
||||||
|
# Create superuser (optional, for admin)
|
||||||
|
python manage.py createsuperuser
|
||||||
|
|
||||||
|
# Start server
|
||||||
|
python manage.py runserver
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker Deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## API Endpoints
|
||||||
|
|
||||||
|
| URL | View | Method | Description |
|
||||||
|
|-----|------|--------|-------------|
|
||||||
|
| `/` | workout_tracker | GET/POST | Main tracker page |
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- Data submitted via form POST as hidden input arrays
|
||||||
|
- Templates are pre-populated via JSON context
|
||||||
|
- Mobile view hides Group/Type columns to save space
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
date,group,type,exercise,set,weight,reps,notes
|
|
||||||
2024-11-21,Primary,Back,One-arm row,1,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Hammer curl,1,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,1,0,25,
|
|
||||||
2024-11-21,Primary,Back,One-arm row,2,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Hammer curl,2,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,2,0,25,
|
|
||||||
2024-11-21,Primary,Back,One-arm row,3,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Hammer curl,3,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,3,0,25,
|
|
||||||
2024-11-21,Primary,Back,One-arm row,4,40,8,SS 35 30
|
|
||||||
2024-11-21,Secondary,Arms,Hammer curl,4,20,8,SS 15 10
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,4,0,25,
|
|
||||||
2024-11-21,Primary,Back,Lat pulldown,1,90,8,
|
|
||||||
2024-11-21,Secondary,Arms,Concentration dumbbell curl,1,15,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,1,0,10,
|
|
||||||
2024-11-21,Primary,Back,Lat pulldown,2,90,8,
|
|
||||||
2024-11-21,Secondary,Arms,Concentration dumbbell curl,2,15,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,2,0,10,
|
|
||||||
2024-11-21,Primary,Back,Lat pulldown,3,90,8,
|
|
||||||
2024-11-21,Secondary,Arms,Concentration dumbbell curl,3,15,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,3,0,10,
|
|
||||||
2024-11-21,Primary,Back,Lat pulldown,4,90,8,SS 80 70
|
|
||||||
2024-11-21,Secondary,Arms,Concentration dumbbell curl,4,15,8,SS 12.5 10
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,4,0,10,
|
|
||||||
2024-11-21,Primary,Back,Cable seated close row,1,70,8,
|
|
||||||
2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,1,70,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,1,0,10,
|
|
||||||
2024-11-21,Primary,Back,Cable seated close row,2,70,8,
|
|
||||||
2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,2,70,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,2,0,10,
|
|
||||||
2024-11-21,Primary,Back,Cable seated close row,3,70,8,
|
|
||||||
2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,3,70,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,3,0,10,
|
|
||||||
2024-11-21,Primary,Back,Cable seated close row,4,70,8,SS 60 50
|
|
||||||
2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,4,70,8,SS 60 50
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,4,0,10,
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
date,group,type,exercise,set,weight,reps,notes
|
|
||||||
2024-11-21,Primary,Chest,Barbell bench press,1,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Triceps kickback,1,15,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,1,0,25,
|
|
||||||
2024-11-21,Primary,Chest,Barbell bench press,2,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Triceps kickback,2,15,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,2,0,25,
|
|
||||||
2024-11-21,Primary,Chest,Barbell bench press,3,40,8,
|
|
||||||
2024-11-21,Secondary,Arms,Triceps kickback,3,15,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,3,0,25,
|
|
||||||
2024-11-21,Primary,Chest,Barbell bench press,4,40,8,SS 35 30
|
|
||||||
2024-11-21,Secondary,Arms,Triceps kickback,4,15,8,SS 12.5 10
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,4,0,25,
|
|
||||||
2024-11-21,Primary,Chest,Decline dumbbell bench press,1,35,8,
|
|
||||||
2024-11-21,Secondary,Core,Decline twisting ab crunch,1,0,10,
|
|
||||||
2024-11-21,Core,Arms,Cable triceps pushdown,1,35,8,
|
|
||||||
2024-11-21,Primary,Chest,Decline dumbbell bench press,2,35,8,
|
|
||||||
2024-11-21,Secondary,Core,Decline twisting ab crunch,2,0,10,
|
|
||||||
2024-11-21,Core,Arms,Cable triceps pushdown,2,35,8,
|
|
||||||
2024-11-21,Primary,Chest,Decline dumbbell bench press,3,35,8,
|
|
||||||
2024-11-21,Secondary,Core,Decline twisting ab crunch,3,0,10,
|
|
||||||
2024-11-21,Core,Arms,Cable triceps pushdown,3,35,8,
|
|
||||||
2024-11-21,Primary,Chest,Decline dumbbell bench press,4,35,8,SS 30 25
|
|
||||||
2024-11-21,Secondary,Core,Decline twisting ab crunch,4,0,10,
|
|
||||||
2024-11-21,Core,Arms,Cable triceps pushdown,4,35,8,SS 30 25
|
|
||||||
2024-11-21,Primary,Chest,Incline dumbbell fly,1,15,8,
|
|
||||||
2024-11-21,Secondary,Arms,Standing single-arm triceps extension,1,15,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,1,0,10,
|
|
||||||
2024-11-21,Primary,Chest,Incline dumbbell fly,2,15,8,
|
|
||||||
2024-11-21,Secondary,Arms,Standing single-arm triceps extension,2,15,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,2,0,10,
|
|
||||||
2024-11-21,Primary,Chest,Incline dumbbell fly,3,15,8,
|
|
||||||
2024-11-21,Secondary,Arms,Standing single-arm triceps extension,3,15,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,3,0,10,
|
|
||||||
2024-11-21,Primary,Chest,Incline dumbbell fly,4,15,8,SS 12.5 10
|
|
||||||
2024-11-21,Secondary,Arms,Standing single-arm triceps extension,4,15,8,SS 12.5 10
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,4,0,10,
|
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
exercise,type,group
|
|
||||||
Cable biceps curl,Arms,Secondary
|
|
||||||
Cable triceps pushdown,Arms,Secondary
|
|
||||||
Cable Underhand Close Grip Pulldown,Arms,Secondary
|
|
||||||
Chair dip (no weights),Arms,Secondary
|
|
||||||
Concentration dumbbell curl,Arms,Secondary
|
|
||||||
Drag curl,Arms,Secondary
|
|
||||||
Dumbbell biceps curl,Arms,Secondary
|
|
||||||
Dumbbell row kickback,Arms,Secondary
|
|
||||||
Hammer curl,Arms,Secondary
|
|
||||||
Kettlebell pullover,Arms,Secondary
|
|
||||||
Lying triceps extension,Arms,Secondary
|
|
||||||
Machine biceps curl,Arms,Secondary
|
|
||||||
Overhead bar press,Arms,Secondary
|
|
||||||
Prone curl,Arms,Secondary
|
|
||||||
Seated preacher curl,Arms,Secondary
|
|
||||||
Standing biceps curl,Arms,Secondary
|
|
||||||
Standing single-arm triceps extension,Arms,Secondary
|
|
||||||
Triceps kickback,Arms,Secondary
|
|
||||||
Assisted pull-up,Back,Primary
|
|
||||||
Barbell bent-over row,Back,Primary
|
|
||||||
Cable seated close row,Back,Primary
|
|
||||||
Cable seated low row,Back,Primary
|
|
||||||
Dumbbell upright row,Back,Primary
|
|
||||||
Incline y raise,Back,Primary
|
|
||||||
Lat pulldown,Back,Primary
|
|
||||||
One-arm row,Back,Primary
|
|
||||||
Seated reverse fly,Back,Primary
|
|
||||||
Barbell bench press,Chest,Primary
|
|
||||||
Cable diagonal raise,Chest,Primary
|
|
||||||
Decline dumbbell bench press,Chest,Primary
|
|
||||||
Decline dumbbell fly,Chest,Primary
|
|
||||||
Dumbbell bench press,Chest,Primary
|
|
||||||
Dumbbell incline bench press,Chest,Primary
|
|
||||||
Incline dumbbell fly,Chest,Primary
|
|
||||||
Machine chest flye,Chest,Primary
|
|
||||||
Ab crunch on a ball,Core,Core
|
|
||||||
Abdominal reverse curl,Core,Core
|
|
||||||
Bench leg raise,Core,Core
|
|
||||||
Bicycle kick,Core,Core
|
|
||||||
Decline twisting ab crunch,Core,Core
|
|
||||||
Elevated-feet plank,Core,Core
|
|
||||||
Jackknife,Core,Core
|
|
||||||
Kettlebell russian twist,Core,Core
|
|
||||||
Plank,Core,Core
|
|
||||||
Russian twist,Core,Core
|
|
||||||
Side plank,Core,Core
|
|
||||||
Superman,Core,Core
|
|
||||||
Swiss-ball crunch,Core,Core
|
|
||||||
Swiss-ball glute bridge,Core,Core
|
|
||||||
Twisting windmill,Core,Core
|
|
||||||
Two-point bridge,Core,Core
|
|
||||||
Burpees,HIIT,Core
|
|
||||||
Mountain climbers,HIIT,Core
|
|
||||||
Squat Jump,HIIT,Core
|
|
||||||
Assisted dumbbell lunge,Legs,Primary
|
|
||||||
Back squat,Legs,Primary
|
|
||||||
Beginner squat,Legs,Primary
|
|
||||||
Bulgarian split squat (no weights),Legs,Primary
|
|
||||||
Dumbbell lunge,Legs,Primary
|
|
||||||
Machine leg curl,Legs,Primary
|
|
||||||
Machine leg extension,Legs,Primary
|
|
||||||
Machine leg press,Legs,Primary
|
|
||||||
Dumbbell front raise,Shoulders,Secondary
|
|
||||||
Dumbbell lateral raise,Shoulders,Secondary
|
|
||||||
Seated dumbbell shoulder press,Shoulders,Secondary
|
|
||||||
Shrug,Shoulders,Secondary
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
date,group,type,exercise,set,weight,reps,notes
|
|
||||||
2024-11-21,Primary,Shoulders,Dumbbell front raise,1,15,10,
|
|
||||||
2024-11-21,Secondary,Legs,Dumbbell Lunge,1,5,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,1,0,10,
|
|
||||||
2024-11-21,Primary,Shoulders,Dumbbell front raise,2,15,10,
|
|
||||||
2024-11-21,Secondary,Legs,Dumbbell lunge,2,5,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,2,0,10,
|
|
||||||
2024-11-21,Primary,Shoulders,Dumbbell front raise,3,15,10,
|
|
||||||
2024-11-21,Secondary,Legs,Dumbbell lunge,3,5,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,3,0,10,
|
|
||||||
2024-11-21,Primary,Shoulders,Dumbbell front raise,4,15,10,
|
|
||||||
2024-11-21,Secondary,Legs,Dumbbell lunge,4,5,8,
|
|
||||||
2024-11-21,Core,Core,Decline twisting ab crunch,4,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Back squat,1,50,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,1,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball glute bridge,1,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Back squat,2,50,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,2,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball glute bridge,2,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Back squat,3,50,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,3,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball glute bridge,3,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Back squat,4,50,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,4,20,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball glute bridge,4,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg extension,1,75,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,1,10,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,1,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg extension,2,75,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,2,10,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,2,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg extension,3,75,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,3,10,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,3,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg extension,4,75,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,4,10,8,
|
|
||||||
2024-11-21,Core,Core,Abdominal reverse curl,4,0,10,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg curl,1,35,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Shrug,1,40,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,1,0,20,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg curl,2,35,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Shrug,2,40,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,2,0,20,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg curl,3,35,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Shrug,3,40,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,3,0,20,
|
|
||||||
2024-11-21,Primary,Legs,Machine leg curl,4,35,8,
|
|
||||||
2024-11-21,Secondary,Shoulders,Shrug,4,40,8,
|
|
||||||
2024-11-21,Core,Core,Swiss-ball crunch,4,0,20,
|
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
width: 15%;
|
width: 15%;
|
||||||
}
|
}
|
||||||
.col-nt {
|
.col-nt {
|
||||||
width: 20%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
<th class="col-set text-center">Set</th>
|
<th class="col-set text-center">Set</th>
|
||||||
<th class="col-rp">Reps</th>
|
<th class="col-rp">Reps</th>
|
||||||
<th class="col-wt">Weight</th>
|
<th class="col-wt">Weight</th>
|
||||||
<th class="col-nt">Note</th>
|
<th class="col-nt text-center">Y</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="activeTableBody"></tbody>
|
<tbody id="activeTableBody"></tbody>
|
||||||
|
|
@ -215,12 +215,12 @@
|
||||||
<th class="text-center">Set</th>
|
<th class="text-center">Set</th>
|
||||||
<th>Reps</th>
|
<th>Reps</th>
|
||||||
<th>Weight</th>
|
<th>Weight</th>
|
||||||
|
<th>Note</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="logTableBody"></tbody>
|
<tbody id="logTableBody"></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="hiddenInputs" class="hidden-inputs"></div>
|
|
||||||
<button type="submit" class="btn btn-success btn-lg w-100 mt-3">
|
<button type="submit" class="btn btn-success btn-lg w-100 mt-3">
|
||||||
End Workout
|
End Workout
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -301,7 +301,7 @@
|
||||||
<td class="col-set text-center">${set}<input type="hidden" class="d-st" value="${set}"></td>
|
<td class="col-set text-center">${set}<input type="hidden" class="d-st" value="${set}"></td>
|
||||||
<td class="col-rp"><input type="number" inputmode="numeric" class="table-input d-rp" value="${reps}"></td>
|
<td class="col-rp"><input type="number" inputmode="numeric" class="table-input d-rp" value="${reps}"></td>
|
||||||
<td class="col-wt"><input type="number" inputmode="decimal" class="table-input d-wt" step="2.5" value="${parseFloat(weight).toFixed(1)}"></td>
|
<td class="col-wt"><input type="number" inputmode="decimal" class="table-input d-wt" step="2.5" value="${parseFloat(weight).toFixed(1)}"></td>
|
||||||
<td class="col-nt"><input type="text" class="table-input d-nt" value="${notes}" placeholder="..."></td>
|
<td class="col-nt text-center"><input type="checkbox" class="form-check-input" style="transform: scale(1.5); margin-top: 8px;"><input type="hidden" class="d-nt" value="${notes}"></td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -378,7 +378,6 @@
|
||||||
function processSaveBlock(tableId) {
|
function processSaveBlock(tableId) {
|
||||||
const activeBody = document.getElementById(tableId);
|
const activeBody = document.getElementById(tableId);
|
||||||
const logBody = document.getElementById('logTableBody');
|
const logBody = document.getElementById('logTableBody');
|
||||||
const hiddenDiv = document.getElementById('hiddenInputs');
|
|
||||||
|
|
||||||
activeBody.querySelectorAll('tr').forEach(row => {
|
activeBody.querySelectorAll('tr').forEach(row => {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -391,16 +390,16 @@
|
||||||
nt: row.querySelector('.d-nt').value
|
nt: row.querySelector('.d-nt').value
|
||||||
};
|
};
|
||||||
|
|
||||||
logBody.insertAdjacentHTML('beforeend', `<tr><td>${data.ex}</td><td class="text-center">${data.st}</td><td>${data.rp}</td><td>${data.wt}</td></tr>`);
|
logBody.insertAdjacentHTML('beforeend', `
|
||||||
hiddenDiv.insertAdjacentHTML('beforeend', `
|
<tr>
|
||||||
<input type="hidden" name="exercise[]" value="${data.ex}">
|
<td>${data.ex}<input type="hidden" name="exercise[]" value="${data.ex}"></td>
|
||||||
|
<td class="text-center">${data.st}<input type="hidden" name="set[]" value="${data.st}"></td>
|
||||||
|
<td><input type="number" name="reps[]" class="table-input p-1" style="font-size:14px" value="${data.rp}"></td>
|
||||||
|
<td><input type="number" name="weight[]" class="table-input p-1" style="font-size:14px" step="2.5" value="${data.wt}"></td>
|
||||||
|
<td><input type="text" name="notes[]" class="table-input p-1 text-start" style="font-size:14px" value="${data.nt}"></td>
|
||||||
<input type="hidden" name="group[]" value="${data.gr}">
|
<input type="hidden" name="group[]" value="${data.gr}">
|
||||||
<input type="hidden" name="type[]" value="${data.ty}">
|
<input type="hidden" name="type[]" value="${data.ty}">
|
||||||
<input type="hidden" name="set[]" value="${data.st}">
|
</tr>`);
|
||||||
<input type="hidden" name="reps[]" value="${data.rp}">
|
|
||||||
<input type="hidden" name="weight[]" value="${data.wt}">
|
|
||||||
<input type="hidden" name="notes[]" value="${data.nt}">
|
|
||||||
`);
|
|
||||||
});
|
});
|
||||||
activeBody.innerHTML = '';
|
activeBody.innerHTML = '';
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue