From 58ffa067b6bb085a35912a9997254eb1057e14ae Mon Sep 17 00:00:00 2001 From: Ester Beltrami Date: Mon, 19 Jan 2026 08:44:54 +0000 Subject: [PATCH] Add internal notes to grants recap --- backend/reviews/admin.py | 17 ++++++++++ backend/reviews/templates/grants-recap.html | 36 +++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/backend/reviews/admin.py b/backend/reviews/admin.py index 219d3f1a2b..1549a6d329 100644 --- a/backend/reviews/admin.py +++ b/backend/reviews/admin.py @@ -293,6 +293,12 @@ def _review_grants_recap_view(self, request, review_session): if key.startswith("reimbursementcategory-") } + notes_updates = { + int(key.split("-")[1]): value + for [key, value] in data.items() + if key.startswith("notes-") + } + grants = list( review_session.conference.grants.filter(id__in=decisions.keys()).all() ) @@ -394,6 +400,17 @@ def _review_grants_recap_view(self, request, review_session): change_message=f"[Review Session] Reimbursement {reimbursement.category.name} added.", ) + # Update internal notes for all grants that have notes changes + if notes_updates: + grants_to_update_notes = review_session.conference.grants.filter( + id__in=notes_updates.keys() + ).all() + for grant in grants_to_update_notes: + new_notes = notes_updates.get(grant.id, "") + if grant.internal_notes != new_notes: + grant.internal_notes = new_notes + grant.save(update_fields=["internal_notes"]) + messages.success( request, "Decisions saved. Check the Grants Summary for more info." ) diff --git a/backend/reviews/templates/grants-recap.html b/backend/reviews/templates/grants-recap.html index f710df78ca..bdf87ad6ac 100644 --- a/backend/reviews/templates/grants-recap.html +++ b/backend/reviews/templates/grants-recap.html @@ -235,6 +235,25 @@ text-decoration: underline; } + .notes-cell { + position: relative; + min-width: 220px; + } + + .notes-textarea { + position: absolute; + top: 8px; + left: 8px; + right: 8px; + bottom: 8px; + width: calc(100% - 16px); + min-height: 80px; + resize: none; + font-size: 12px; + padding: 5px; + box-sizing: border-box; + } + /* Center-align columns */ .results-table th:nth-child(1), /* number column */ .results-table th:nth-child(3), /* score column */ @@ -616,6 +635,12 @@

+ +
+ Notes +
+
+ @@ -816,6 +841,17 @@

{% else %} No permission to change. {% endif %} + + {% if perms.reviews.decision_reviewsession %} + + {% else %} + {{ item.internal_notes|default:"-" }} + {% endif %} + {% endfor %}