[moods] Add notes field to mood check-in

This commit is contained in:
2026-08-24 14:18:25 -04:00
parent 19c42783b0
commit 78f57f94f2
3 changed files with 13 additions and 1 deletions

View File

@ -18,7 +18,7 @@ tasks, Todoist tasks, web pages I've read and trails I've hiked has turned out
to be sometimes cathartic and sometimes functional as I try to remember when I to be sometimes cathartic and sometimes functional as I try to remember when I
did a thing. did a thing.
* Backlog [0/30] :vrobbler:project:personal: * Backlog [1/31] :vrobbler:project:personal:
** TODO [#C] Configure IMAP folder/start in user profile :imap:settings: ** TODO [#C] Configure IMAP folder/start in user profile :imap:settings:
*** Description *** Description
@ -590,3 +590,8 @@ The Edit log form should have from top to bottom:
- People (which should be similar to the Bird widget on BirdLocation and allow setting per user score, win true/false, rank, new true/false, seat_ordrer) - People (which should be similar to the Bird widget on BirdLocation and allow setting per user score, win true/false, rank, new true/false, seat_ordrer)
- Expansion ids (which should a multi-select widget of expansions for this game) - Expansion ids (which should a multi-select widget of expansions for this game)
- Location (which should be a drop down of BoardGameLocations for this user) - Location (which should be a drop down of BoardGameLocations for this user)
** DONE When checking about moods, the last page should provide a small form to add notes :scrobbles:mood:checkin:
:PROPERTIES:
:ID: ed744d3f-86fb-e9f8-acb9-0e4200c99c7f
:END:

View File

@ -9,6 +9,11 @@
<h2 class="mb-4">Why are you feeling this way?</h2> <h2 class="mb-4">Why are you feeling this way?</h2>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<div class="mb-4">
<label for="notes" class="form-label">Notes (optional)</label>
<textarea name="notes" id="notes" rows="3" class="form-control"
placeholder="Anything else on your mind?"></textarea>
</div>
<div class="d-grid gap-3"> <div class="d-grid gap-3">
<button type="submit" name="reason" value="" <button type="submit" name="reason" value=""
class="btn btn-outline-secondary btn-lg"> class="btn btn-outline-secondary btn-lg">

View File

@ -56,6 +56,7 @@ def checkin(request):
reason_id = request.POST.get("reason") reason_id = request.POST.get("reason")
mood_id = request.session.get("checkin_mood_id") mood_id = request.session.get("checkin_mood_id")
quality = request.session.get("checkin_quality") quality = request.session.get("checkin_quality")
notes = request.POST.get("notes")
if mood_id and quality: if mood_id and quality:
try: try:
@ -64,6 +65,7 @@ def checkin(request):
mood_quality=quality, mood_quality=quality,
mood_type=mood.mood_type, mood_type=mood.mood_type,
mood_reason_ids=[int(reason_id)] if reason_id else [], mood_reason_ids=[int(reason_id)] if reason_id else [],
notes=[notes.strip()] if notes and notes.strip() else None,
) )
# Attempt to add current weather from most recent location # Attempt to add current weather from most recent location