153 lines
8.1 KiB
HTML
153 lines
8.1 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
|
|
<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">{{ workout['PersonName'] }}</h3>
|
|
</div>
|
|
<form action="{{ url_for('delete_workout', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}"
|
|
method="delete">
|
|
<button
|
|
class="sm:inline-flex text-white bg-red-200 hover:bg-red-700 focus:ring-4 focus:ring-red-200 font-medium rounded-lg text-sm px-5 py-2.5 text-center items-center mt-6"
|
|
type="submit">Delete
|
|
workout</button>
|
|
</form>
|
|
</div>
|
|
|
|
<form action="{{ url_for('update_workout', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}"
|
|
method="post">
|
|
<div class="relative">
|
|
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
|
<svg aria-hidden="true" class="w-5 h-5 text-gray-500 dark:text-gray-400" fill="currentColor"
|
|
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
<path fill-rule="evenodd"
|
|
d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
|
|
clip-rule="evenodd"></path>
|
|
</svg>
|
|
</div>
|
|
<input type="date"
|
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 w-full md:w-1/4"
|
|
name="start-date" value="{{ workout['StartDate'] }}">
|
|
</div>
|
|
|
|
<button
|
|
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-4"
|
|
type="submit">Update</button>
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="bg-white shadow rounded-lg mb-4 p-4 sm:p-6 h-full mt-4">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h3 class="text-xl font-bold leading-none text-gray-900">Top Sets</h3>
|
|
|
|
</div>
|
|
<div class="flow-root">
|
|
|
|
{% if workout['TopSets']|length > 0 %}
|
|
<table class="items-center w-full bg-transparent border-collapse">
|
|
<thead>
|
|
<tr>
|
|
<th
|
|
class="px-4 bg-gray-50 text-gray-700 align-middle py-3 text-xs font-semibold text-left uppercase border-l-0 border-r-0 whitespace-nowrap">
|
|
Exercise</th>
|
|
<th
|
|
class="px-4 bg-gray-50 text-gray-700 align-middle py-3 text-xs font-semibold text-left uppercase border-l-0 border-r-0 whitespace-nowrap">
|
|
Top Set</th>
|
|
<th
|
|
class="px-4 bg-gray-50 text-gray-700 align-middle py-3 text-xs font-semibold text-left uppercase border-l-0 border-r-0 whitespace-nowrap min-w-140-px w-8">
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
{% for t in workout['TopSets'] %}
|
|
<tr class="text-gray-500">
|
|
<th class="border-t-0 px-4 align-middle text-l font-normal whitespace-nowrap p-4 text-left">
|
|
{{ t['ExerciseName'] }}</th>
|
|
</th>
|
|
<td class="border-t-0 px-4 align-middle text-l font-medium text-gray-900 whitespace-nowrap p-4">
|
|
{{ t['Repetitions'] }} x {{ t['Weight'] }}kg</td>
|
|
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
|
|
<a href="{{ url_for('get_topset', person_id=workout['PersonId'], workout_id=workout['WorkoutId'], 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="{{ url_for('delete_topset', person_id=workout['PersonId'], workout_id=workout['WorkoutId'], 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>
|
|
{% endif %}
|
|
|
|
{% if workout['TopSets']|length == 0 %}
|
|
<div class="bg-purple-100 rounded-lg py-5 px-6 mb-4 text-base text-purple-700 mb-3" role="alert">
|
|
No topsets found.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<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="{{ url_for('create_topset', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}"
|
|
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">
|
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-state">
|
|
Exercise
|
|
</label>
|
|
<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" name="exercise_id">
|
|
{% for e in workout['Exercises'] %}
|
|
<option value="{{ e['ExerciseId'] }}">{{
|
|
e['Name']}}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<div
|
|
class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
|
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
|
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-city">
|
|
Reps
|
|
</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" name="repetitions">
|
|
</div>
|
|
|
|
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
|
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-zip">
|
|
Weight
|
|
</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" name="weight" step="any">
|
|
</div>
|
|
</div>
|
|
<button
|
|
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"
|
|
type="submit">
|
|
Add top set
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %} |