diff options
| author | FivePixels <o5pxels@gmail.com> | 2022-05-04 18:04:46 -0500 |
|---|---|---|
| committer | FivePixels <o5pxels@gmail.com> | 2022-05-04 18:04:46 -0500 |
| commit | cd14ca37470771042d05e2ece187acf568c41058 (patch) | |
| tree | 3b5eb1b21b9208ba0ac7487b75c2ed1f30510588 /app/templates | |
| parent | 4b14772bc37d57482f9d1da6581329a8fbdc4cc7 (diff) | |
| download | Strengthy-cd14ca37470771042d05e2ece187acf568c41058.tar.xz Strengthy-cd14ca37470771042d05e2ece187acf568c41058.zip | |
Refactor loop logic on record.html, start work on timer on record page
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/workout/record.html | 91 |
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 "> |
