diff options
| author | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 20:52:42 -0600 |
|---|---|---|
| committer | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 20:52:42 -0600 |
| commit | 157ddaa68fafb1f8e0bd0d8335517eb402c5988f (patch) | |
| tree | c47f545424b5e7cae811fb5d9448c8399bb9d528 /app/templates | |
| parent | 34988c3d22dd00f5dc7f68ff06ba71d146008257 (diff) | |
| download | Strengthy-main.tar.xz Strengthy-main.zip | |
Add progress page, cleanup timer formattingmain
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/base/layout.html | 102 | ||||
| -rw-r--r-- | app/templates/progress.html | 22 | ||||
| -rw-r--r-- | app/templates/workout/record.html | 57 | ||||
| -rw-r--r-- | app/templates/workout/record_select.html | 17 |
4 files changed, 116 insertions, 82 deletions
diff --git a/app/templates/base/layout.html b/app/templates/base/layout.html index afe6143..9628eb4 100644 --- a/app/templates/base/layout.html +++ b/app/templates/base/layout.html @@ -37,59 +37,68 @@ <div class="navbar-menu" id="nav-menu"> <div class="navbar-start"> {% if current_user.is_authenticated %} - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/home"> - <span class="icon"> - <i class="fa fa-home"></i> - </span> - <span>Home</span> - </a> - </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/home"> + <span class="icon"> + <i class="fa fa-home"></i> + </span> + <span>Home</span> + </a> + </span> - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/workout/record"> - <span class="icon"> - <i class="fa fa-pencil"></i> - </span> - <span>Record a Workout</span> - </a> - </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/workout/record"> + <span class="icon"> + <i class="fa fa-pencil"></i> + </span> + <span>Record a Workout</span> + </a> + </span> - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/workout/create"> - <span class="icon"> - <i class="fa fa-plus"></i> - </span> - <span>Create a Workout</span> - </a> - </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/workout/create"> + <span class="icon"> + <i class="fa fa-plus"></i> + </span> + <span>Create a Workout</span> + </a> + </span> + + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/progress"> + <span class="icon"> + <i class="fa fa-tasks"></i> + </span> + <span>Your Progress</span> + </a> + </span> {% endif %} </div> <div class="navbar-end"> {% if current_user.is_authenticated %} - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/logout"> - <span>Log Out</span> - </a> - </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/logout"> + <span>Log Out</span> + </a> + </span> {% else %} - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/login"> - <span class="icon"> - <i class="fa fa-user"></i> - </span> - <span>Login</span> - </a> - </span> - <span class="navbar-item"> - <a class="button is-white is-outlined" href="/register"> - <span class="icon"> - <i class="fa fa-pencil"></i> - </span> - <span>Sign Up</span> - </a> - </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/login"> + <span class="icon"> + <i class="fa fa-user"></i> + </span> + <span>Login</span> + </a> + </span> + <span class="navbar-item"> + <a class="button is-white is-outlined" href="/register"> + <span class="icon"> + <i class="fa fa-pencil"></i> + </span> + <span>Sign Up</span> + </a> + </span> {% endif %} </div> </div> @@ -104,4 +113,5 @@ <!-- TODO: footer --> <script async type="text/javascript" src="/static/js/bulma.js"></script> </body> -</html> + +</html>
\ No newline at end of file diff --git a/app/templates/progress.html b/app/templates/progress.html new file mode 100644 index 0000000..c20484c --- /dev/null +++ b/app/templates/progress.html @@ -0,0 +1,22 @@ +{% extends 'base/layout.html' %} + +{% block content %} +<div class="container"> + {% for completed_workout in exercises %} + <div class="columns"> + <div class="column is-12"> + <div class="box"> + <canvas id="chart-{{ loop.index }}"> + </div> + </div> + </div> + {% endfor %} +</div> + +<script type="text/javascript" src="/static/js/chart.js"></script> +<script> + {% for completed_workout in exercises %} + exercise_chart('chart-{{ loop.index }}', {{ exercises[loop.index0].id }}, "{{ exercises[loop.index0].name }}"); + {% endfor %} +</script> +{% endblock %}
\ No newline at end of file diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html index 1cfeda1..8207e1b 100644 --- a/app/templates/workout/record.html +++ b/app/templates/workout/record.html @@ -25,35 +25,36 @@ {% 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', type='number', onkeydown='onKeyDown(event)') }}</td> - <td>{{ set['units'](class_='input', onkeydown='onKeyDown(event)') }}</td> - {% endif %} - <td> - <a class="button" onClick="onClickSetCheck(this)"> + <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-check"></i> + <i class="fa fa-play"></i> </span> - </a> - </td> - </tr> - {% endfor %} + </button> + <span style='padding-left: 15px;' id='timer-time-{{ outer_loop.index }}'> + {{ '%02d' % (exercise.units / 60) }}:{{ '%02d' % (exercise.units % 60) }} + </span> + </div> + </td> + {% else %} + <td>{{ set['lbs'](class_='input', type='number', onkeydown='onKeyDown(event)') }}</td> + <td>{{ set['units'](class_='input', onkeydown='onKeyDown(event)') }}</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"> @@ -80,4 +81,4 @@ <script async type="text/javascript" src="/static/js/record.js"></script> -{% endblock %} +{% endblock %}
\ No newline at end of file diff --git a/app/templates/workout/record_select.html b/app/templates/workout/record_select.html index e6d88e6..2aaa3f0 100644 --- a/app/templates/workout/record_select.html +++ b/app/templates/workout/record_select.html @@ -13,14 +13,15 @@ <div class="content"> Exercises: {% for exercise in workout.exercises %} - <p>{{ exercise.sets }} x {{ exercise.units }}{% if exercise.type =='time' %} seconds{% endif %} x {{ exercise.name }}</p> + <p>{{ exercise.sets }}{% if exercise.type != 'time' %} x {{ exercise.units }}{% endif %} x {{ + exercise.name }}</p> {% endfor %} - <a class="button is-primary" href="/workout/record/{{ workout.id }}"> - <span class="icon is-small"> - <i class="fa fa-play"></i> - </span> - <span>Start</span> - </a> + <a class="button is-primary" href="/workout/record/{{ workout.id }}"> + <span class="icon is-small"> + <i class="fa fa-play"></i> + </span> + <span>Start</span> + </a> </div> </div> </div> @@ -47,4 +48,4 @@ </div> </div> -{% endblock %} +{% endblock %}
\ No newline at end of file |
