Add cursor pointer styling to buttons

This commit is contained in:
Peter Stockings
2022-11-20 12:55:20 +11:00
parent b1be914b75
commit ba601c8085
4 changed files with 31 additions and 28 deletions

36
app.py
View File

@@ -67,7 +67,7 @@ def get_workout_start_date_edit_form(person_id, workout_id):
</div> </div>
<a <a
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer"
hx-put="{url_for('update_workout_start_date', person_id=person_id, workout_id=workout_id)}" hx-put="{url_for('update_workout_start_date', person_id=person_id, workout_id=workout_id)}"
hx-include="[name='start-date']"> hx-include="[name='start-date']">
Update Update
@@ -75,7 +75,7 @@ def get_workout_start_date_edit_form(person_id, workout_id):
<a <a
hx-get="{url_for('get_workout_start_date', person_id=person_id, workout_id=workout_id)}" hx-get="{url_for('get_workout_start_date', person_id=person_id, workout_id=workout_id)}"
hx-target="#edit-start-date" hx-target="#edit-start-date"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Cancel Cancel
</a> </a>
""" """
@@ -88,7 +88,7 @@ def update_workout_start_date(person_id, workout_id):
db.update_workout_start_date(workout_id, new_start_date) db.update_workout_start_date(workout_id, new_start_date)
return f""" return f"""
<span class="text-base font-normal text-gray-500">{new_start_date}</span> <span class="text-base font-normal text-gray-500">{new_start_date}</span>
<a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2" <a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer"
hx-get="{ url_for('get_workout_start_date_edit_form', person_id=person_id, workout_id=workout_id) }" hx-get="{ url_for('get_workout_start_date_edit_form', person_id=person_id, workout_id=workout_id) }"
hx-target="#edit-start-date"> hx-target="#edit-start-date">
Edit Edit
@@ -102,7 +102,7 @@ def get_workout_start_date(person_id, workout_id):
workout = db.get_workout(person_id, workout_id) workout = db.get_workout(person_id, workout_id)
return f""" return f"""
<span class="text-base font-normal text-gray-500">{workout['StartDate']}</span> <span class="text-base font-normal text-gray-500">{workout['StartDate']}</span>
<a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2" <a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer"
hx-get="{ url_for('get_workout_start_date_edit_form', person_id=person_id, workout_id=workout_id) }" hx-get="{ url_for('get_workout_start_date_edit_form', person_id=person_id, workout_id=workout_id) }"
hx-target="#edit-start-date"> hx-target="#edit-start-date">
Edit Edit
@@ -123,11 +123,11 @@ def get_topset(person_id, workout_id, topset_id):
{ topset['Repetitions'] } x { topset['Weight'] }kg</td> { topset['Repetitions'] } x { topset['Weight'] }kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4"> <td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a hx-get="{ url_for('get_topset_edit_form',person_id=person_id, workout_id=workout_id, topset_id=topset_id) }" <a hx-get="{ url_for('get_topset_edit_form',person_id=person_id, workout_id=workout_id, topset_id=topset_id) }"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=topset_id) }" <a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=topset_id) }"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Delete Delete
</a> </a>
</td> </td>
@@ -163,11 +163,11 @@ def create_topset(person_id, workout_id):
{repetitions} x {weight}kg</td> {repetitions} x {weight}kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4"> <td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a href="{ url_for('get_topset_edit_form', person_id=person_id, workout_id=workout_id, topset_id=new_top_set_id) }" <a href="{ url_for('get_topset_edit_form', person_id=person_id, workout_id=workout_id, topset_id=new_top_set_id) }"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=new_top_set_id)}" <a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=new_top_set_id)}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Delete Delete
</a> </a>
</td> </td>
@@ -194,11 +194,11 @@ def update_topset(person_id, workout_id, topset_id):
{repetitions} x {weight}kg</td> {repetitions} x {weight}kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4"> <td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a hx-get="{ url_for('get_topset_edit_form', person_id=person_id, workout_id=workout_id, topset_id=topset_id) }" <a hx-get="{ url_for('get_topset_edit_form', person_id=person_id, workout_id=workout_id, topset_id=topset_id) }"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=topset_id)}" <a hx-delete="{ url_for('delete_topset', person_id=person_id, workout_id=workout_id, topset_id=topset_id)}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Delete Delete
</a> </a>
</td> </td>
@@ -236,10 +236,10 @@ def create_exercise():
{name} {name}
</td> </td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900"> <td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a hx-get="{ url_for('get_exercise_edit_form', exercise_id=new_exercise_id) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-get="{ url_for('get_exercise_edit_form', exercise_id=new_exercise_id) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{url_for('delete_exercise', exercise_id=new_exercise_id)}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-delete="{url_for('delete_exercise', exercise_id=new_exercise_id)}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Remove Remove
</a> </a>
</td> </td>
@@ -256,10 +256,10 @@ def get_exercise(exercise_id):
{exercise['Name']} {exercise['Name']}
</td> </td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900"> <td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a hx-get="{ url_for('get_exercise_edit_form', exercise_id=exercise['ExerciseId']) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-get="{ url_for('get_exercise_edit_form', exercise_id=exercise['ExerciseId']) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{url_for('delete_exercise', exercise_id=exercise['ExerciseId'])}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-delete="{url_for('delete_exercise', exercise_id=exercise['ExerciseId'])}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Remove Remove
</a> </a>
</td> </td>
@@ -276,10 +276,10 @@ def get_exercise_edit_form(exercise_id):
<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" type="text" name="name" value="{exercise['Name']}"> <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" type="text" name="name" value="{exercise['Name']}">
</td> </td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900"> <td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a hx-put="{ url_for('update_exercise', exercise_id=exercise['ExerciseId']) }" hx-include="closest tr" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-put="{ url_for('update_exercise', exercise_id=exercise['ExerciseId']) }" hx-include="closest tr" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Update Update
</a> </a>
<a hx-get="{url_for('get_exercise', exercise_id=exercise['ExerciseId'])}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-get="{url_for('get_exercise', exercise_id=exercise['ExerciseId'])}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Cancel Cancel
</a> </a>
</td> </td>
@@ -297,10 +297,10 @@ def update_exercise(exercise_id):
{new_name} {new_name}
</td> </td>
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900"> <td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a hx-get="{ url_for('get_exercise_edit_form', exercise_id=exercise_id) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-get="{ url_for('get_exercise_edit_form', exercise_id=exercise_id) }" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{url_for('delete_exercise', exercise_id=exercise_id)}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> <a hx-delete="{url_for('delete_exercise', exercise_id=exercise_id)}" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Remove Remove
</a> </a>
</td> </td>

View File

@@ -14,19 +14,22 @@
<div class="flex items-center"> <div class="flex items-center">
<input type="number" <input type="number"
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" 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="repetitions" value="{{ topset['Repetitions'] }}"> x <input type="number" name="repetitions" value="{{ topset['Repetitions'] }}">
<p class="px-2">x</p>
<input type="number"
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" 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="weight" value="{{ topset['Weight'] }}">kg name="weight" value="{{ topset['Weight'] }}">
<p class="px-2">kg</p>
</div> </div>
</td> </td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4"> <td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a hx-put="{{ url_for('update_topset', person_id=topset['PersonId'], workout_id=topset['WorkoutId'], topset_id=topset['TopSetId']) }}" <a hx-put="{{ url_for('update_topset', person_id=topset['PersonId'], workout_id=topset['WorkoutId'], topset_id=topset['TopSetId']) }}"
hx-include="[name='exercise_id'], [name='repetitions'], [name='weight']" hx-include="[name='exercise_id'], [name='repetitions'], [name='weight']"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Update Update
</a> </a>
<a hx-get="{{ url_for('get_topset', person_id=topset['PersonId'], workout_id=topset['WorkoutId'], topset_id=topset['TopSetId']) }}" <a hx-get="{{ url_for('get_topset', person_id=topset['PersonId'], workout_id=topset['WorkoutId'], topset_id=topset['TopSetId']) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Cancel Cancel
</a> </a>
</td> </td>

View File

@@ -63,7 +63,7 @@
<td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900"> <td class="p-4 whitespace-nowrap text-sm font-semibold text-gray-900">
<a href="{{ url_for('get_workout' ,person_id=person['PersonId'], workout_id=w['WorkoutId']) }}" <a href="{{ url_for('get_workout' ,person_id=person['PersonId'], workout_id=w['WorkoutId']) }}"
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
@@ -71,7 +71,7 @@
action="{{ url_for('delete_workout', person_id=person['PersonId'], workout_id=w['WorkoutId']) }}" action="{{ url_for('delete_workout', person_id=person['PersonId'], workout_id=w['WorkoutId']) }}"
method="delete" class="inline"> method="delete" class="inline">
<button <button
class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2" class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer"
type="submit">Delete</button> type="submit">Delete</button>
</form> </form>
</td> </td>

View File

@@ -11,7 +11,7 @@
<form action="{{ url_for('delete_workout', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}" <form action="{{ url_for('delete_workout', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}"
method="delete"> method="delete">
<button <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" 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 cursor-pointer"
type="submit">Delete type="submit">Delete
workout</button> workout</button>
</form> </form>
@@ -19,7 +19,7 @@
<div id="edit-start-date" hx-target="this" hx-swap="innerHTML swap:0.5s"> <div id="edit-start-date" hx-target="this" hx-swap="innerHTML swap:0.5s">
<span class="text-base font-normal text-gray-500">{{ workout['StartDate'] }}</span> <span class="text-base font-normal text-gray-500">{{ workout['StartDate'] }}</span>
<a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2" <a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer"
hx-get="{{ url_for('get_workout_start_date_edit_form', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}" hx-get="{{ url_for('get_workout_start_date_edit_form', person_id=workout['PersonId'], workout_id=workout['WorkoutId']) }}"
hx-target="#edit-start-date"> hx-target="#edit-start-date">
Edit Edit
@@ -60,11 +60,11 @@
{{ t['Repetitions'] }} x {{ t['Weight'] }}kg</td> {{ t['Repetitions'] }} x {{ t['Weight'] }}kg</td>
<td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4"> <td class="border-t-0 px-4 align-middle text-xs whitespace-nowrap p-4">
<a hx-get="{{ url_for('get_topset_edit_form', person_id=workout['PersonId'], workout_id=workout['WorkoutId'], topset_id=t['TopSetId']) }}" <a hx-get="{{ url_for('get_topset_edit_form', 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"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Edit Edit
</a> </a>
<a hx-delete="{{ url_for('delete_topset', person_id=workout['PersonId'], workout_id=workout['WorkoutId'], topset_id=t['TopSetId'])}}" <a hx-delete="{{ 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"> class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer">
Delete Delete
</a> </a>
</td> </td>