Add basic workout tracking functionality, create/edit/delete workouts and there topsets

This commit is contained in:
Peter Stockings
2022-07-18 21:30:12 +10:00
parent 93ae1fa04b
commit 07f19b38c6
7 changed files with 403 additions and 367 deletions

View File

@@ -57,10 +57,9 @@
<div class="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto">
<div class="flex-1 px-3 bg-white divide-y space-y-1">
<ul class="space-y-2 pb-2">
<li>
<a href="{{ url_for('dashboard') }}"
class="text-base text-gray-900 font-normal rounded-lg flex items-center p-2 hover:bg-gray-100 group">
class="text-base text-gray-900 font-normal rounded-lg flex items-center p-2 hover:bg-gray-100 group {{ is_selected_page(url_for('dashboard')) }}">
<svg class="w-6 h-6 text-gray-500 group-hover:text-gray-900 transition duration-75"
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path>
@@ -70,34 +69,24 @@
</a>
</li>
{% for p in get_list_of_people_and_workout_count() %}
<li>
<a href="{{ url_for('display_workouts_for_person' ,person_id=1) }}"
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 flex items-center p-2 group ">
<a href="{{ url_for('display_workouts_for_person' ,person_id=p['PersonId']) }}"
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 flex items-center p-2 group {% if p['IsActive']==1 %} bg-gray-200 {% endif %}">
<svg class="w-6 h-6 text-gray-500 flex-shrink-0 group-hover:text-gray-900 transition duration-75"
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd">
</path>
</svg>
<span class="ml-3 flex-1 whitespace-nowrap">Gabe</span>
<span class="ml-3 flex-1 whitespace-nowrap">{{ p['Name']}}</span>
<span
class="bg-gray-200 text-gray-800 ml-3 text-sm font-medium inline-flex items-center justify-center px-2 rounded-full">5</span>
</a>
</li>
<li>
<a href="{{ url_for('display_workouts_for_person' ,person_id=2) }}"
class="text-base text-gray-900 font-normal rounded-lg hover:bg-gray-100 flex items-center p-2 group ">
<svg class="w-6 h-6 text-gray-500 flex-shrink-0 group-hover:text-gray-900 transition duration-75"
fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd">
</path>
</svg>
<span class="ml-3 flex-1 whitespace-nowrap">Michael</span>
<span
class="bg-gray-200 text-gray-800 ml-3 text-sm font-medium inline-flex items-center justify-center px-2 rounded-full">0</span>
class="bg-gray-200 text-gray-800 ml-3 text-sm font-medium inline-flex items-center justify-center px-2 rounded-full">{{
p['NumberOfWorkouts'] }}</span>
</a>
</li>
{% endfor %}
</ul>
<div class="space-y-2 pt-2">
<a href="https://github.com/themesberg/windster-tailwind-css-dashboard/issues"

View File

@@ -7,7 +7,7 @@
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">Error: {{ error }}</strong>
<span class="block sm:inline">{{ message }}</span>
<a class="absolute top-0 bottom-0 right-0 px-4 py-3" href="/">
<a class="absolute top-0 bottom-0 right-0 px-4 py-3" href="{{ url }}">
<svg class="fill-current h-6 w-6 text-red-500" role="button" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20">
<title>Close</title>

View File

@@ -2,13 +2,13 @@
{% block content %}
<div class="w-full grid grid-cols-1 xl:grid-cols-2 2xl:grid-cols-2 gap-4">
<div class="w-full grid grid-cols-1 xl:grid-cols-3 2xl:grid-cols-3 gap-4">
<div class="bg-white shadow rounded-lg p-4 sm:p-6 xl:p-8 ">
<div class="mb-4 flex items-center justify-between">
<div>
<h3 class="text-xl font-bold text-gray-900 mb-2">Gabe</h3>
<span class="text-base font-normal text-gray-500">List of rep maxes</span>
<span class="text-base font-normal text-gray-500">Current rep maxes</span>
</div>
<div class="flex-shrink-0">
<a href="{{ url_for('display_workouts_for_person' ,person_id=1) }}"
@@ -20,6 +20,7 @@
<div class="overflow-x-auto rounded-lg">
<div class="align-middle inline-block min-w-full">
<div class="shadow overflow-hidden sm:rounded-lg">
<h4 class="text-l font-semibold text-blue-400 mb-2 text-center">Bench</h4>
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
@@ -29,16 +30,11 @@
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Exercise
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Reps
Rep Max
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Weight
Estimated 1 Rep max
</th>
</tr>
</thead>
@@ -47,98 +43,118 @@
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
130kg
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="flex flex-col mt-8">
<div class="overflow-x-auto rounded-lg">
<div class="align-middle inline-block min-w-full">
<div class="shadow overflow-hidden sm:rounded-lg">
<h4 class="text-l font-semibold text-blue-400 mb-2 text-center">Squat</h4>
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Date
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Rep Max
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Estimated 1 Rep max
</th>
</tr>
</thead>
<tbody class="bg-white">
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
</tbody>
@@ -154,7 +170,7 @@
<div class="mb-4 flex items-center justify-between">
<div>
<h3 class="text-xl font-bold text-gray-900 mb-2">Michael</h3>
<span class="text-base font-normal text-gray-500">List of rep maxes</span>
<span class="text-base font-normal text-gray-500">Current rep maxes</span>
</div>
<div class="flex-shrink-0">
<a href="{{ url_for('display_workouts_for_person' ,person_id=2) }}"
@@ -166,24 +182,21 @@
<div class="overflow-x-auto rounded-lg">
<div class="align-middle inline-block min-w-full">
<div class="shadow overflow-hidden sm:rounded-lg">
<h4 class="text-l font-semibold text-blue-400 mb-2 text-center">Bench</h4>
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Exercise
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Date
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Reps
Rep Max
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Weight
Estimated 1 Rep max
</th>
</tr>
</thead>
@@ -192,98 +205,118 @@
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
130kg
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="flex flex-col mt-8">
<div class="overflow-x-auto rounded-lg">
<div class="align-middle inline-block min-w-full">
<div class="shadow overflow-hidden sm:rounded-lg">
<h4 class="text-l font-semibold text-blue-400 mb-2 text-center">Squat</h4>
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Date
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Rep Max
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Estimated 1 Rep max
</th>
</tr>
</thead>
<tbody class="bg-white">
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
Squats
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 100kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
100kg
130kg
</td>
</tr>
</tbody>
@@ -293,6 +326,7 @@
</div>
</div>
</div>
</div>
<div class="mt-4 w-full grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4">

View File

@@ -28,7 +28,7 @@
<div class="relative">
<select
class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-state">
id="grid-state" name="exercise_id">
{% for e in exercises %}
<option value="{{ e['ExcerciseId'] }}" {% if topset['ExcerciseId']==e['ExcerciseId'] %}
selected {% endif %}>{{
@@ -50,7 +50,7 @@
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-city" type="number" value="{{ topset['Repetitions']}}">
id="grid-city" type="number" value="{{ topset['Repetitions']}}" name="repetitions">
</div>
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
@@ -59,7 +59,7 @@
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-zip" type="number" value="{{ topset['Weight']}}">
id="grid-zip" type="number" value="{{ topset['Weight']}}" name="weight">
</div>
</div>
<button

View File

@@ -6,8 +6,8 @@
<div class="mb-4 flex items-center justify-between">
<div>
<h3 class="text-xl font-bold text-gray-900 mb-2">Gabe</h3>
<span class="text-base font-normal text-gray-500">Apr 23 ,2021</span>
<h3 class="text-xl font-bold text-gray-900 mb-2">{{ workout_info['Name'] }}</h3>
<span class="text-base font-normal text-gray-500">{{ workout_info['StartDate'] }}</span>
</div>
<a href="#" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete workout
@@ -37,55 +37,25 @@
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
{% for t in top_sets %}
<tr class="text-gray-500">
<th class="border-t-0 px-4 align-middle text-l font-normal whitespace-nowrap p-4 text-left">Squats
<th class="border-t-0 px-4 align-middle text-l font-normal whitespace-nowrap p-4 text-left">
{{ t['Name'] }}
</th>
<td class="border-t-0 px-4 align-middle text-l font-medium text-gray-900 whitespace-nowrap p-4">
5 x 60kg</td>
{{ t['TopSet'] }}</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a href="{{ url_for('show_topset_from_workout_for_person' ,person_id=person_id, workout_id=workout_id, topset_id=1) }}"
<a href="{{ url_for('show_topset_from_workout_for_person', person_id=person_id, workout_id=workout_id, topset_id=t['TopSetId']) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr class="text-gray-500">
<th class="border-t-0 px-4 align-middle text-l font-normal whitespace-nowrap p-4 text-left">Bench
</th>
<td class="border-t-0 px-4 align-middle text-l font-medium text-gray-900 whitespace-nowrap p-4">
5 x 60kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a href="{{ url_for('show_topset_from_workout_for_person' ,person_id=person_id, workout_id=workout_id, topset_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr class="text-gray-500">
<th class="border-t-0 px-4 align-middle text-l font-normal whitespace-nowrap p-4 text-left">Lat
Pulldowns
</th>
<td class="border-t-0 px-4 align-middle text-l font-medium text-gray-900 whitespace-nowrap p-4">
5 x 60kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a href="{{ url_for('show_topset_from_workout_for_person' ,person_id=person_id, workout_id=workout_id, topset_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
<a href="{{ url_for('delete_topset_from_workout_for_person', person_id=person_id, workout_id=workout_id, topset_id=t['TopSetId'])}}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
@@ -93,7 +63,9 @@
<div class="bg-white shadow rounded-lg p-4 sm:p-6 xl:p-8 2xl:col-span-2 mt-4">
<div class=" ">
<form class="w-full max-w-lg" action="" method="post">
<form class="w-full max-w-lg"
action="{{ url_for('add_topset_to_workout_for_person', person_id=person_id, workout_id=workout_id) }}"
method="post">
<div class="flex flex-wrap -mx-3 mb-2">
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
@@ -103,10 +75,11 @@
<div class="relative">
<select
class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-state">
<option value="1">Squats</option>
<option value="2">Bench</option>
<option value="3">Deadlift</option>
id="grid-state" name="exercise_id">
{% for e in exercises %}
<option value="{{ e['ExcerciseId'] }}">{{
e['Name']}}</option>
{% endfor %}
</select>
<div
class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
@@ -123,7 +96,7 @@
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-city" type="number">
id="grid-city" type="number" name="repetitions">
</div>
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
@@ -132,7 +105,7 @@
</label>
<input
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"
id="grid-zip" type="number">
id="grid-zip" type="number" name="weight">
</div>
</div>
<button

View File

@@ -6,7 +6,7 @@
<div class="mb-4 flex items-center justify-between">
<div>
<h3 class="text-xl font-bold text-gray-900 mb-2">Gabe</h3>
<h3 class="text-xl font-bold text-gray-900 mb-2">{{ person['Name'] }}</h3>
<span class="text-base font-normal text-gray-500">List of workouts</span>
</div>
</div>
@@ -22,222 +22,50 @@
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Date
</th>
{% for e in exercises %}
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Squats
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Bench
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Deadlift
</th>
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Lat Pulldown
{{ e['Name'] }}
</th>
{% endfor %}
<th scope="col"
class="p-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider w-8">
</th>
</tr>
</thead>
<tbody class="bg-white">
{% for w in workouts %}
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
{{ w['start_date'] }}
</td>
{% for e in exercises %}
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
{% if e['ExcerciseId'] in w['topset_exercises'] %}
{{ w['topset_exercises'][e['ExcerciseId']] }}
{% endif %}
</td>
{% endfor %}
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=w['workout_id']) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
<tr>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-500">
Apr 23 ,2021
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-normal text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
5 x 60kg
</td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('show_workout_for_person' ,person_id=person_id, workout_id=1) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Edit
</a>
<a href="#"
<a href="{{ url_for('delete_workout_from_person', person_id=person_id, workout_id=w['workout_id'])}}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2">
Delete
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href=" {{ url_for('new_workout_for_person', person_id=person_id) }}"
class="sm:inline-flex text-white bg-cyan-600 hover:bg-cyan-700 focus:ring-4 focus:ring-cyan-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center">
class="sm:inline-flex text-white bg-cyan-600 hover:bg-cyan-700 focus:ring-4 focus:ring-cyan-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mt-6">
New workout
</a>
</div>