SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 75dd3f5d authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add invitations to nomination details

parent 38099a6f
No related branches found
No related tags found
1 merge request!58[Fellowship Nominations] Rework the fellowship nomination system and UI
...@@ -436,3 +436,14 @@ class FellowshipInvitation(models.Model): ...@@ -436,3 +436,14 @@ class FellowshipInvitation(models.Model):
@property @property
def declined(self): def declined(self):
return self.response == self.RESPONSE_DECLINED return self.response == self.RESPONSE_DECLINED
@property
def get_response_color(self):
if self.response in [self.RESPONSE_ACCEPTED, self.RESPONSE_POSTPONED]:
return "success"
elif self.response in [self.RESPONSE_DECLINED, self.RESPONSE_NOT_YET_INVITED]:
return "danger"
elif self.response in [self.RESPONSE_UNRESPONSIVE]:
return "warning"
else:
return "primary"
...@@ -129,12 +129,45 @@ ...@@ -129,12 +129,45 @@
</div> </div>
</div> </div>
<details open class="card"> <details class="card mb-3">
<summary class="card-header list-triangle">Voting Rounds</summary> <summary class="card-header list-triangle">Voting Rounds</summary>
<div class="card-body"> <div class="card-body">
<div hx-get="{% url 'colleges:_hx_nomination_voting_rounds_tab' nomination_id=nomination.id round_id=nomination.latest_voting_round.id|default:0 %}" <div hx-get="{% url 'colleges:_hx_nomination_voting_rounds_tab' nomination_id=nomination.id round_id=nomination.latest_voting_round.id|default:0 %}"
hx-trigger="intersect once"></div> hx-trigger="intersect once"></div>
</div> </div>
</details> </details>
{% if "edadmin" in user_roles and nomination.decision.outcome == 'elected' %}
<details open class="card">
<summary class="card-header d-flex flex-row justify-content-between list-triangle">
<div>Invitation</div>
<div>{{ nomination.invitation.get_response_display }}</div>
</summary>
<div class="card-body">
<div class="row mb-0">
<div class="col-auto">
<div class="mb-4">
<h3>Invitation status</h3>
<div class="fs-6 badge bg-{{ nomination.invitation.get_response_color }}">
{{ nomination.invitation.get_response_display }}
</div>
</div>
<div>
<h3>Checklist</h3>
{% include "colleges/_nominations_invitation_checklist.html" with invitation=nomination.invitation %}
</div>
</div>
<div class="col-12 col-md p-2">
<h4>Update the response to this invitation:</h4>
<div id="invitation-{{ nomination.invitation.id }}-update-response"
hx-get="{% url 'colleges:_hx_fellowship_invitation_update_response' invitation_id=nomination.invitation.id %}"
hx-trigger="intersect once"></div>
</div>
</div>
</div>
</details>
{% endif %}
</div> </div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment