summaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorFivePixels <o5pxels@gmail.com>2022-05-08 17:13:04 -0500
committerFivePixels <o5pxels@gmail.com>2022-05-08 17:13:04 -0500
commit39b1035b0ab1a1437de8b45a971525d18a69adae (patch)
treef75723f816f738da9b2984eab1145bd73983db29 /app/templates
parent3fd02681d178298551b0f8f3bba93964be30d4ca (diff)
downloadStrengthy-39b1035b0ab1a1437de8b45a971525d18a69adae.tar.xz
Strengthy-39b1035b0ab1a1437de8b45a971525d18a69adae.zip
Update record.js for timer support, partially working
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/workout/record.html54
1 files changed, 30 insertions, 24 deletions
diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html
index 9b10f2d..8c8eaf2 100644
--- a/app/templates/workout/record.html
+++ b/app/templates/workout/record.html
@@ -5,6 +5,7 @@
{% block form %}
<div>
{% for exercise in workout.exercises %}
+ {% set outer_loop = loop %}
{{ form.exercises.entries[loop.index0]['id'] }}
<h1 class="title is-4 has-text-black">{{ exercise.name }}</h1>
<div>
@@ -21,33 +22,38 @@
</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)">
+ {% if exercise.type == 'time' %}
+ <tr data-is-timer=true data-timer-seconds={{ exercise.units}}>
+ {% else %}
+ <tr data-is-reps=true>
+ {% endif %}
+ <th>{{ loop.index }}</th>
+ {% if exercise.type == 'time' %}
+ <td>
+ <div class='timer-{{ outer_loop.index }}'style="display:flex;align-items:center;font-size:1em;">
+ <button type="button" onclick="onClickPausePlayTimer(this)" class="button">
+ <span class="icon is-small">
+ <i class="fa fa-play"></i>
+ </span>
+ </button>
+ <span style='padding-left: 15px;' id='timer-time'>
+ {{ exercise.units }} seconds
+ </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-play"></i>
+ <i class="fa fa-check"></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 %}
+ </td>
+ </tr>
+ {% endfor %}
</tbody>
</table>
<div class="buttons is-centered">