summaryrefslogtreecommitdiff
path: root/app/templates/workout/record.html
blob: c7152cdc7c3f8b7a107920b7c426f0fdaeef0c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{% extends 'base/form.html' %}

{% block title %}Record {{ workout.name }}{% endblock %}

{% 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>
		<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 %}
				{% 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' style="display:flex;align-items:center;font-size:1em;">
								<button id='timer-{{ outer_loop.index }}' 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-{{ outer_loop.index }}'>
									{{ 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-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>
	{% endfor %}
</div>

<div class="field is-horizontal is-grouped is-grouped-right">
	<button class="button is-success ">
		<span class="icon is-small">
			<i class="fa fa-check"></i>
		</span>
		<span>Finish Workout</span>
	</button>
</div>

<script async type="text/javascript" src="/static/js/record.js"></script>

{% endblock %}