summaryrefslogtreecommitdiff
path: root/app/templates/workout/record.html
diff options
context:
space:
mode:
authorFivePixels <o5pxels@gmail.com>2022-05-04 18:04:46 -0500
committerFivePixels <o5pxels@gmail.com>2022-05-04 18:04:46 -0500
commitcd14ca37470771042d05e2ece187acf568c41058 (patch)
tree3b5eb1b21b9208ba0ac7487b75c2ed1f30510588 /app/templates/workout/record.html
parent4b14772bc37d57482f9d1da6581329a8fbdc4cc7 (diff)
downloadStrengthy-cd14ca37470771042d05e2ece187acf568c41058.tar.xz
Strengthy-cd14ca37470771042d05e2ece187acf568c41058.zip
Refactor loop logic on record.html, start work on timer on record page
Diffstat (limited to 'app/templates/workout/record.html')
-rw-r--r--app/templates/workout/record.html91
1 files changed, 55 insertions, 36 deletions
diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html
index b953a3d..9e93805 100644
--- a/app/templates/workout/record.html
+++ b/app/templates/workout/record.html
@@ -3,45 +3,64 @@
{% block title %}Record {{ workout.name }}{% endblock %}
{% block form %}
-{% for exercise in form.exercises.entries %}
<div>
- {{ 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>
- <th>lbs</th>
- <th>Reps</th>
- <th>Done</th>
- </thead>
- <tbody>
- {% for set in exercise.sets.entries %}
- <tr>
- <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">
- <i class="fa fa-check"></i>
- </span>
- </a>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <div class="buttons is-centered">
- <a class="button is-primary" onClick="onClickAddSet(this)">
- <span class="icon is-small">
- <i class="fa fa-plus"></i>
- </span>
- <span>Add Set</span>
- </a>
+ {% for exercise in workout.exercises %}
+ <h1 class="title is-4 has-text-black">{{ exercise.name }}</h1>
+ <div>
+ <table class="table is-fullwidth is-hoverable">
+ <thead>
+ <th>Set</th>
+ {% if exercise.type == 'time' %}
+ <th>Timer</th>
+ {% else %}
+ <th>lbs</th>
+ <th>Reps</th>
+ {% endif %}
+ <th>Done</th>
+ </thead>
+ <tbody>
+ {% for set in form.exercises.entries[loop.index0].sets.entries %}
+ <tr>
+ <th>{{ loop.index }}</th>
+ {% if exercise.type == 'time' %}
+ <td>
+ <div class="timer">
+ <a class="button" onClick="onClickPausePlayTimer(this)">
+ <span class="icon is-small">
+ <i class="fa fa-play"></i>
+ </span>
+ </a>
+ <span class="{{ ['units'] }}">
+ </span>
+ </div>
+ </td>
+ {% else %}
+ <td>{{ set['lbs'](class_='input') }}</td>
+ <td>{{ set['units'](class_='input') }}</td>
+ {% endif %}
+ <td>
+ <a class="button" onClick="onClickSetCheck(this)">
+ <span class="icon is-small">
+ <i class="fa fa-check"></i>
+ </span>
+ </a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <div class="buttons is-centered">
+ <a class="button is-primary" onClick="onClickAddSet(this)">
+ <span class="icon is-small">
+ <i class="fa fa-plus"></i>
+ </span>
+ <span>Add Set</span>
+ </a>
+ </div>
+ <hr>
</div>
- <hr>
+ {% endfor %}
</div>
-{% endfor %}
<div class="field is-horizontal is-grouped is-grouped-right">
<button class="button is-success ">