Add page/route to create new workout for person
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<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">
|
||||
|
||||
<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">
|
||||
<option value="1">Squats</option>
|
||||
<option value="2">Bench</option>
|
||||
<option value="3">Deadlift</option>
|
||||
</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">
|
||||
</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">
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded">
|
||||
Add top set
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>Workout Tracker</title>
|
||||
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -59,7 +59,7 @@
|
||||
<ul class="space-y-2 pb-2">
|
||||
|
||||
<li>
|
||||
<a href="https://demo.themesberg.com/windster/"
|
||||
<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">
|
||||
<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">
|
||||
@@ -71,7 +71,7 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="https://demo.themesberg.com/windster/users/list/"
|
||||
<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 ">
|
||||
<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">
|
||||
@@ -85,7 +85,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://demo.themesberg.com/windster/users/list/"
|
||||
<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">
|
||||
@@ -179,6 +179,5 @@
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
</html>
|
||||
@@ -11,7 +11,8 @@
|
||||
<span class="text-base font-normal text-gray-500">List of rep maxes</span>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="#" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg p-2">View workouts</a>
|
||||
<a href="{{ url_for('display_workouts_for_person' ,person_id=1) }}"
|
||||
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg p-2">View workouts</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,7 +157,8 @@
|
||||
<span class="text-base font-normal text-gray-500">List of rep maxes</span>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="#" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg p-2">View workouts</a>
|
||||
<a href="{{ url_for('display_workouts_for_person' ,person_id=2) }}"
|
||||
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg p-2">View workouts</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
158
templates/new_workout.html
Normal file
158
templates/new_workout.html
Normal file
@@ -0,0 +1,158 @@
|
||||
{% 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">Gabe</h3>
|
||||
<span class="text-base font-normal text-gray-500">Apr 23 ,2021</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
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</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">
|
||||
<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">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="text-gray-500">
|
||||
<th class="border-t-0 px-4 align-middle text-sm font-normal whitespace-nowrap p-4 text-left">Squats
|
||||
</th>
|
||||
<td class="border-t-0 px-4 align-middle text-xs 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="#"
|
||||
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>
|
||||
</tbody>
|
||||
</table>
|
||||
</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="" 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">
|
||||
<option value="1">Squats</option>
|
||||
<option value="2">Bench</option>
|
||||
<option value="3">Deadlift</option>
|
||||
</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">
|
||||
</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">
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded"
|
||||
type="submit">
|
||||
Add top set
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -163,6 +163,17 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href=" {{ url_for('new_workout_for_person', person_id=person_id) }}"
|
||||
class="hidden sm:inline-flex ml-5 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 mr-3">
|
||||
<svg class="svg-inline--fa fa-gem -ml-1 mr-2 h-4 w-4" aria-hidden="true" focusable="false"
|
||||
data-prefix="fas" data-icon="gem" role="img" xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 512 512">
|
||||
<path fill="currentColor"
|
||||
d="M378.7 32H133.3L256 182.7L378.7 32zM512 192l-107.4-141.3L289.6 192H512zM107.4 50.67L0 192h222.4L107.4 50.67zM244.3 474.9C247.3 478.2 251.6 480 256 480s8.653-1.828 11.67-5.062L510.6 224H1.365L244.3 474.9z">
|
||||
</path>
|
||||
</svg>
|
||||
Add workout
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user