Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions backend/reviews/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down Expand Up @@ -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."
)
Expand Down
36 changes: 36 additions & 0 deletions backend/reviews/templates/grants-recap.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -616,6 +635,12 @@ <h3>
</div>
<div class="clear"></div>
</th>
<th scope="col">
<div class="text">
<span>Notes</span>
</div>
<div class="clear"></div>
</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -816,6 +841,17 @@ <h3>
</ul>
{% else %} No permission to change. {% endif %}
</td>
<td class="notes-cell">
{% if perms.reviews.decision_reviewsession %}
<textarea
name="notes-{{ item.id }}"
class="notes-textarea"
placeholder="Internal notes..."
>{{ item.internal_notes }}</textarea>
{% else %}
{{ item.internal_notes|default:"-" }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
Expand Down
Loading