Skip to content

Commit 86ec5c8

Browse files
committed
Add info if user submitted a grant in another conference organized by the same organizer
1 parent 85b5b6a commit 86ec5c8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

backend/reviews/admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,11 @@ def _render_grant_review(
631631
comment = request.GET.get("comment", user_review.comment if user_review else "")
632632

633633
grant = Grant.objects.get(id=review_item_id)
634+
previous_grants = Grant.objects.filter(
635+
user_id=grant.user_id,
636+
conference__organizer_id=grant.conference.organizer_id,
637+
).exclude(conference_id=grant.conference_id)
638+
634639
context = dict(
635640
self.admin_site.each_context(request),
636641
grant=grant,
@@ -640,6 +645,7 @@ def _render_grant_review(
640645
conference_id=grant.conference_id,
641646
)
642647
.exists(),
648+
previous_grants=previous_grants,
643649
available_scores=AvailableScoreOption.objects.filter(
644650
review_session_id=review_session.id
645651
).order_by("-numeric_value"),

backend/reviews/templates/grant-review.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,29 @@ <h2 class="grant-header">
138138
<div>{{has_sent_proposal|yesno}}</div>
139139
</div>
140140

141+
<div class="review-row">
142+
{% if previous_grants %}
143+
<h2>Previous Grants</h2>
144+
<table>
145+
<thead>
146+
<tr>
147+
<th>Conference</th>
148+
<th>Status</th>
149+
</tr>
150+
</thead>
151+
<tbody>
152+
{% for previous_grant in previous_grants %}
153+
<tr>
154+
<td>{{ previous_grant.conference.name }}</td>
155+
<td>{{ previous_grant.get_status_display }}</td>
156+
</tr>
157+
{% endfor %}
158+
</tbody>
159+
</table>
160+
{% else %}
161+
<p>The user has not submitted a grant in other conferences organized by the same organizer.</p>
162+
{% endif %}
163+
</div>
141164
</div>
142165

143166
<div>

0 commit comments

Comments
 (0)