summaryrefslogtreecommitdiff
path: root/app/templates/workout
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-24 19:27:41 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-24 19:27:41 -0500
commit0dd74e2b672053e3296bc814a36988ba8463854f (patch)
treeccd0c41d15324513f419fa2b157d65268b6b63b2 /app/templates/workout
parent586285028845c8ed9a2e859f1266c233b8278311 (diff)
downloadStrengthy-0dd74e2b672053e3296bc814a36988ba8463854f.tar.xz
Strengthy-0dd74e2b672053e3296bc814a36988ba8463854f.zip
Workout records are now written to the database
Diffstat (limited to 'app/templates/workout')
-rw-r--r--app/templates/workout/create.html2
-rw-r--r--app/templates/workout/record.html14
2 files changed, 8 insertions, 8 deletions
diff --git a/app/templates/workout/create.html b/app/templates/workout/create.html
index 333aca6..a84b457 100644
--- a/app/templates/workout/create.html
+++ b/app/templates/workout/create.html
@@ -64,7 +64,7 @@
</div>
<div class="field is-horizontal is-grouped is-grouped-right">
- <p id="add" class="button is-primary">
+ <p id="add" class="button is-primary" onclick="handleAdd()">
<span class="icon is-small">
<i class="fa fa-plus"></i>
</span>
diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html
index d7e29f8..aa58ff4 100644
--- a/app/templates/workout/record.html
+++ b/app/templates/workout/record.html
@@ -3,10 +3,10 @@
{% block title %}Record {{ workout.name }}{% endblock %}
{% block form %}
-{% for exercise in workout.exercises %}
-{% set outer_loop = loop %}
+{% for exercise in form.exercises.entries %}
<div>
- <h1 id="{{ exercise.name }}" class="title is-4 has-text-black">{{ exercise.name }}</h1>
+ {{ exercise['id'] }}
+ <h1 class="title is-4 has-text-black">{{ workout.exercises[loop.index0].name }}</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
<th>Set</th>
@@ -15,11 +15,11 @@
<th>Done</th>
</thead>
<tbody>
- {% for i in range(exercise.sets) %}
+ {% for set in exercise.sets.entries %}
<tr>
- <th>{{ i + 1 }}</th>
- <td><input class="input" name="exercises-{{ outer_loop.index0 }}-sets-{{ i }}-lbs" type="number"></td>
- <td><input class="input" name="exercises-{{ outer_loop.index0 }}-sets-{{ i }}-reps" type="number"></td>
+ <th>{{ loop.index }}</th>
+ <td>{{ set['lbs'](class_='input') }}</td>
+ <td>{{ set['units'](class_='input') }}</td>
<td>
<a class="button" onClick="onClickSetCheck(this)">
<span class="icon is-small">