Add view to list workout notes for a person

This commit is contained in:
Peter Stockings
2024-03-09 18:50:44 +11:00
parent e3de9f886b
commit dae4fcbf44
6 changed files with 165 additions and 5 deletions

View File

@@ -1,16 +1,16 @@
<div id="workout-note" hx-target="this" hx-swap="outerHTML swap:0.5s">
<div id="workout-note-{{workout_id}}" hx-target="this" hx-swap="outerHTML swap:0.5s">
{% if is_edit|default(false, true) == false %}
{% if note|length > 0 %}
<span class="text-base font-normal text-gray-500 whitespace-normal">{{ note | replace('\n', '<br>') | safe }}</span>
<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_note_edit_form', person_id=person_id, workout_id=workout_id) }}"
hx-target="#workout-note">
hx-target="#workout-note-{{workout_id}}">
Edit
</a>
{% else %}
<a class="text-sm font-medium text-cyan-600 hover:bg-gray-100 rounded-lg inline-flex items-center p-2 cursor-pointer float-none sm:float-right"
hx-get="{{ url_for('get_workout_note_edit_form', person_id=person_id, workout_id=workout_id) }}"
hx-target="#workout-note">
hx-target="#workout-note-{{workout_id}}">
Add note
</a>
{% endif %}
@@ -25,7 +25,7 @@
<button
class="inline-flex justify-center p-2 text-blue-600 rounded-full cursor-pointer hover:bg-blue-100 dark:text-blue-500 dark:hover:bg-gray-600"
hx-get="{{ url_for('get_workout_note', person_id=person_id, workout_id=workout_id) }}"
hx-target="#workout-note">
hx-target="#workout-note-{{workout_id}}">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />