Skip to content

Commit 3d051f9

Browse files
committedSep 15, 2024··
Add AidCategory
1 parent b685dae commit 3d051f9

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generated by Django 5.0.8 on 2024-09-12 10:03
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("conferences", "0045_conference_logo"),
9+
(
10+
"conferences",
11+
"0045_remove_conference_grants_default_accommodation_amount_and_more",
12+
),
13+
]
14+
15+
operations = []

‎backend/grants/models.py

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class AidType(models.TextChoices):
3737
help_text="Automatically include this category in grants by default",
3838
)
3939

40+
objects = GrantQuerySet().as_manager()
41+
4042
def __str__(self):
4143
return f"{self.name} ({self.conference.name})"
4244

@@ -55,6 +57,8 @@ class CountryAidAmount(models.Model):
5557
max_digits=6, decimal_places=0, help_text=_("Maximum amount for this category")
5658
)
5759

60+
objects = GrantQuerySet().as_manager()
61+
5862
def __str__(self):
5963
return f"{self.country} ({self.conference.name}) - {self.max_amount}€"
6064

‎backend/reviews/admin.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from django.urls import path, reverse
1818
from django.utils.safestring import mark_safe
1919

20-
from grants.models import Grant
20+
from grants.models import Grant, AidCategory
2121
from participants.models import Participant
2222
from reviews.models import AvailableScoreOption, ReviewSession, UserReview
2323
from submissions.models import Submission, SubmissionTag
@@ -376,6 +376,12 @@ def _review_grants_recap_view(self, request, review_session):
376376
for choice in Grant.Status.choices
377377
if choice[0] in Grant.REVIEW_SESSION_STATUSES_OPTIONS
378378
],
379+
all_approved_category=[
380+
category
381+
for category in AidCategory.objects.filter(
382+
conference_id=review_session.conference_id
383+
)
384+
],
379385
all_statuses=Grant.Status.choices,
380386
review_session=review_session,
381387
title="Recap",

‎backend/reviews/templates/grants-recap.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,15 @@ <h3>
623623
<td>
624624
{% if perms.reviews.decision_reviewsession %}
625625
<ul
626-
data-item-id="{{ item.id }}"
627-
class="approved-type-choices {% if item.status != 'approved' %}hidden{% endif %}"
626+
data-item-id="{{ item.id }}"
627+
class="approved-type-choices {% if item.status != 'approved' %}hidden{% endif %}"
628628
>
629-
{% for approved_type in all_approved_types %}
629+
{% for category in all_approved_category %}
630630
<li>
631631
<label>
632-
<input {% if item.approved_type == approved_type.0 %}checked{% endif %}
633-
type="radio" name="approvedtype-{{item.id}}" value="{{approved_type.0}}" />
634-
{{approved_type.1}}
632+
<input {% if item.approved_type == category.id %}checked{% endif %}
633+
type="radio" name="approvedaidcategory-{{item.id}}" value="{{category.id}}" />
634+
{{category.name}}
635635
</label>
636636
</li>
637637
{% endfor %}

0 commit comments

Comments
 (0)
Please sign in to comment.