SciPost Code Repository

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

change layout for nomination decisions

parent 75dd3f5d
No related branches found
No related tags found
1 merge request!58[Fellowship Nominations] Rework the fellowship nomination system and UI
......@@ -2,58 +2,16 @@
{% load automarkup %}
<div id="nomination-{{ voting_round.id }}-decision">
{% with blocks=voting_round.decision_blocks %}
{% if voting_round.decision %}
<div class="row">
<div class="col-auto">
<h3>Decision</h3>
{% if voting_round.decision.outcome == 'elected' %}
<div class="badge fs-5 mb-2 bg-success">{{ voting_round.decision.get_outcome_display }}</div>
{% elif voting_round.decision.outcome == 'notelected' %}
<div class="badge fs-5 mb-2 bg-danger">{{ voting_round.decision.get_outcome_display }}</div>
{% endif %}
</div>
{% if voting_round.decision.comments %}
<div class="col">
<h4>Decision comments</h4>
<p>{{ voting_round.decision.comments }}</p>
</div>
{% endif %}
</div>
{% else %}
{% if "edadmin" in user_roles %}
{% if voting_round.is_open %}
<p class="text-warning">The voting round is still open. You many not draft a decision yet.</p>
{% elif voting_round.is_scheduled %}
<p class="text-warning">The voting round is scheduled but has not yet started.</p>
{% elif voting_round.is_unscheduled %}
<p class="text-warning">The voting round is not yet scheduled.</p>
{% else %}
{% with blocks=voting_round.decision_blocks %}
{% if blocks %}
<p>The decision cannot be fixed at this moment: {{ blocks }}</p>
{% else %}
<form hx-post="{% url 'colleges:_hx_nomination_decision_form' round_id=voting_round.id %}"
hx-target="#nomination-{{ voting_round.id }}-decision">
{% crispy decision_form %}
</form>
{% endif %}
{% endwith %}
{% endif %}
{% if blocks %}
<p>The decision cannot be fixed at this moment: {{ blocks }}</p>
{% else %}
<p class="text-warning">No decision has been formulated yet.</p>
<form hx-post="{% url 'colleges:_hx_nomination_decision_form' round_id=voting_round.id %}"
hx-target="#nomination-{{ voting_round.id }}-decision">
{% crispy decision_form %}
</form>
{% endif %}
{% endif %}
{% endwith %}
</div>
......@@ -8,43 +8,54 @@
hx-trigger="intersect once"></div>
</div>
{% if "edadmin" in user_roles and not voting_round.is_closed %}
<div class="col-4">
<h4>Add new voter</h4>
<form hx-post="{% url 'colleges:_hx_fellowship_dynsel_list' %}"
hx-trigger="keyup delay:200ms, change"
hx-target="#nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_results">
<div id="nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_form">
{% crispy voter_add_form %}
</div>
</form>
<div id="nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_results"></div>
<h5>Add senior fellows</h5>
<button type="button"
class="mb-2 btn btn-primary btn-sm"
hx-get="{% url 'colleges:_hx_nomination_round_add_eligible_voter_set' round_id=voting_round.id voter_set_name='with_specialty_overlap' %}"
hx-target="#nomination-{{ voting_round.nomination.id }}-round-{{ voting_round.id }}-voters">
With specialty overlap
</button>
<button type="button"
class="mb-2 btn btn-warning text-white btn-sm"
hx-get="{% url 'colleges:_hx_nomination_round_add_eligible_voter_set' round_id=voting_round.id voter_set_name='all_seniors' %}"
hx-target="#nomination-{{ voting_round.nomination.id }}-round-{{ voting_round.id }}-voters">
ALL seniors
</button>
</div>
<div class="col-auto d-flex flex-column justify-content-between">
{% if not voting_round.is_closed %}
{% if "edadmin" in user_roles %}
{% elif session_fellowship and session_fellowship in voting_round.eligible_to_vote.all %}
{% if voting_round.is_open %}
<div id="nomination-{{ voting_round.nomination.id }}-vote"
class="col-12 col-md-4"
hx-get="{% url 'colleges:_hx_nomination_vote' voting_round_id=voting_round.id %}"
hx-trigger="intersect once"></div>
{% elif voting_round.decision %}
<div class="col-12 col-md-4 d-flex flex-column justify-content-between">
<div>{% include "colleges/_voting_results_box.html" with voting_round=voting_round %}</div>
<div>
<h4>Add new voter</h4>
<form hx-post="{% url 'colleges:_hx_fellowship_dynsel_list' %}"
hx-trigger="keyup delay:200ms, change"
hx-target="#nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_results">
<div id="nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_form">
{% crispy voter_add_form %}
</div>
</form>
<div id="nomination-{{ voting_round.nomination.id }}_round-{{ voting_round.id }}_add_voter_results"></div>
</div>
<div>
<h5>Add senior fellows</h5>
<button type="button"
class="mb-2 btn btn-primary btn-sm"
hx-get="{% url 'colleges:_hx_nomination_round_add_eligible_voter_set' round_id=voting_round.id voter_set_name='with_specialty_overlap' %}"
hx-target="#nomination-{{ voting_round.nomination.id }}-round-{{ voting_round.id }}-voters">
With specialty overlap
</button>
<button type="button"
class="mb-2 btn btn-warning text-white btn-sm"
hx-get="{% url 'colleges:_hx_nomination_round_add_eligible_voter_set' round_id=voting_round.id voter_set_name='all_seniors' %}"
hx-target="#nomination-{{ voting_round.nomination.id }}-round-{{ voting_round.id }}-voters">
ALL seniors
</button>
</div>
{% elif session_fellowship and session_fellowship in voting_round.eligible_to_vote.all %}
<div id="nomination-{{ voting_round.nomination.id }}-vote"
class="col-12 col-md-4"
hx-get="{% url 'colleges:_hx_nomination_vote' voting_round_id=voting_round.id %}"
hx-trigger="intersect once"></div>
{% endif %}
{% else %}
<div>{% include "colleges/_voting_results_box.html" with voting_round=voting_round %}</div>
{% if voting_round.decision %}
<div>
<h3>Decision</h3>
......@@ -58,32 +69,28 @@
<h4 class="mt-2">Decision comments</h4>
<span>{{ voting_round.decision.comments }}</span>
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% if "edadmin" in user_roles %}
{% if voting_round.is_closed %}
<div class="row mb-0">
<div class="col-12 col-md mt-3">
<div hx-get="{% url 'colleges:_hx_nomination_decision_form' round_id=voting_round.id %}"
hx-trigger="intersect once"></div>
</div>
<div class="col-auto mt-3">{% include "colleges/_voting_results_box.html" with voting_round=voting_round %}</div>
</div>
{% else %}
{% if not voting_round.is_closed %}
<div class="col-12">
<h4>Start round</h4>
{% crispy round_start_form %}
</div>
{% elif voting_round.is_closed and not voting_round.decision %}
<div hx-get="{% url 'colleges:_hx_nomination_decision_form' round_id=voting_round.id %}"
hx-trigger="intersect once"></div>
{% endif %}
{% endif %}
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