Skip to content

Commit 41ef8a9

Browse files
committed
added correct collapse/show logic
1 parent 0cc8eca commit 41ef8a9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

evap/evaluation/templates/evaluation_form_general_questionnaires.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
{% include 'bootstrap_form_field_label.html' with field=field class='col-md-3 pe-4' %}
1616
<div class="col-md-7 card collapsible overflow-visible">
1717
<div class="card-header d-flex">
18-
<a class="collapse-toggle collapsed"
18+
<a class="collapse-toggle {% if collapse_participants and evaluation.participants.count > 0 %}collapsed{% else %}show{% endif %}"
1919
data-bs-toggle="collapse" href="#contributor-{{ contribution_result.contributor.id }}"
2020
aria-controls="contributor-{{ contribution_result.contributor.id }}">
2121
</a>
2222
<span class="badge rounded-pill badge-btn ms-auto"> {{ evaluation.participants.count }} </span>
2323
</div>
24-
<div class="collapse {% if False %} show{% endif %}" id="contributor-{{ contribution_result.contributor.id }}">
24+
<div class="{% if collapse_participants and evaluation.participants.count > 0 %}collapse{% else %}show{% endif %}" id="contributor-{{ contribution_result.contributor.id }}">
2525
<div class="card-body">
2626
{% include 'bootstrap_form_field_widget.html' with field=field %}
2727
</div>

evap/staff/templates/staff_evaluation_form.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h3>
3838

3939
<div class="card mb-3">
4040
<div class="card-body">
41-
{% include 'evaluation_form_general_questionnaires.html' with evaluation=evaluation evaluation_form=evaluation_form %}
41+
{% include 'evaluation_form_general_questionnaires.html' with evaluation=evaluation evaluation_form=evaluation_form collapse_participants=True %}
4242
</div>
4343
</div>
4444
<div class="card mb-3">

0 commit comments

Comments
 (0)