Integrate session note and tag editing and center progress controls

This commit is contained in:
Peter Stockings
2026-09-06 22:38:11 +10:00
parent d5e3e1d930
commit dc0f41cd27
12 changed files with 156 additions and 110 deletions
+28
View File
@@ -0,0 +1,28 @@
<section id="workout-note-{{ workout_id }}" class="workout-card workout-note-card"
hx-target="this" hx-swap="outerHTML">
{% if is_edit|default(false) %}
<form class="workout-note-editor"
hx-put="{{ url_for('notes.update_workout_note', person_id=person_id, workout_id=workout_id, view='session') }}"
hx-disabled-elt="find button"
_="on htmx:responseError remove .hidden from #note-error-{{ workout_id }}">
<label for="session-note-input-{{ workout_id }}">Session notes</label>
<textarea id="session-note-input-{{ workout_id }}" name="note" rows="5"
placeholder="Cues, energy, how it felt…"
_="init call me.focus() end">{{ note or '' }}</textarea>
<p id="note-error-{{ workout_id }}" class="workout-editor-error hidden" role="alert">Could not save your note. Please try again.</p>
<div class="workout-editor-actions">
<button type="button" class="workout-button"
hx-get="{{ url_for('notes.get_workout_note', person_id=person_id, workout_id=workout_id, view='session') }}">Cancel</button>
<button type="submit" class="workout-add-button">Save note</button>
</div>
</form>
{% else %}
<button type="button" class="workout-note-trigger"
hx-get="{{ url_for('notes.get_workout_note_edit_form', person_id=person_id, workout_id=workout_id, view='session') }}"
aria-label="{{ 'Edit session notes' if note else 'Add session notes' }}">
<span class="workout-inline-heading">Session notes <span class="workout-inline-action">{{ 'Edit' if note else '+ Add' }}</span></span>
{% if note %}<span class="workout-note-preview">{% for line in note.split('\n') %}{{ line }}{% if not loop.last %}<br>{% endif %}{% endfor %}</span>
{% else %}<span class="workout-subtle">Cues, energy, how it felt</span>{% endif %}
</button>
{% endif %}
</section>