Skip to content

Commit fdcdb90

Browse files
committed
extract skip questions dropdown to an include
Can then adjust style everywhere, plus less duplicate code
1 parent e091c13 commit fdcdb90

5 files changed

+17
-52
lines changed

crowdsourcer/templates/crowdsourcer/authority_audit_questions.html

+1-13
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ <h1 class="mb-3 mb-md-4">
1414
</h1>
1515

1616
<div class="sticky-top py-3 bg-white border-bottom" style="margin-bottom: -1px;">
17-
<div class="dropdown">
18-
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
19-
Skip to question
20-
</button>
21-
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
22-
{% for q_form in form %}
23-
<li><a class="dropdown-item d-flex" style="max-width: 30em; white-space: normal;" href="#q{{q_form.question_obj.number_and_part}}">
24-
<span style="width: 2em; flex: 0 0 auto;">Q{{q_form.question_obj.number_and_part}}</span>
25-
<span class="text-muted fs-7 ms-3">{{ q_form.question_obj.description }}</span>
26-
</a></li>
27-
{% endfor %}
28-
</ul>
29-
</div>
17+
{% include "crowdsourcer/includes/skip_questions_dropdown.html" with form=form%}
3018
</div>
3119

3220
{% if message %}

crowdsourcer/templates/crowdsourcer/authority_questions.html

+1-13
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,7 @@ <h1 class="mb-3 mb-md-4">
2020
</div>
2121
{% endif %}
2222

23-
<div class="dropdown">
24-
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
25-
Skip to question
26-
</button>
27-
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
28-
{% for q_form in form %}
29-
<li><a class="dropdown-item d-flex" style="max-width: 30em; white-space: normal;" href="#q{{q_form.question_obj.number_and_part}}">
30-
<span style="width: 2em; flex: 0 0 auto;">Q{{q_form.question_obj.number_and_part}}</span>
31-
<span class="text-muted fs-7 ms-3">{{ q_form.question_obj.description }}</span>
32-
</a></li>
33-
{% endfor %}
34-
</ul>
35-
</div>
23+
{% include "crowdsourcer/includes/skip_questions_dropdown.html" with form=form%}
3624
</div>
3725

3826
{% if message %}

crowdsourcer/templates/crowdsourcer/authority_questions_with_previous.html

+1-13
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@ <h1 class="mb-3 mb-md-4">
2121
</div>
2222
{% endif %}
2323

24-
<div class="dropdown">
25-
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
26-
Skip to question
27-
</button>
28-
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
29-
{% for q_form in form %}
30-
<li><a class="dropdown-item d-flex" style="max-width: 30em; white-space: normal;" href="#q{{q_form.question_obj.number_and_part}}">
31-
<span style="width: 2em; flex: 0 0 auto;">Q{{q_form.question_obj.number_and_part}}</span>
32-
<span class="text-muted fs-7 ms-3">{{ q_form.question_obj.description }}</span>
33-
</a></li>
34-
{% endfor %}
35-
</ul>
36-
</div>
24+
{% include "crowdsourcer/includes/skip_questions_dropdown.html" with form=form%}
3725
</div>
3826

3927
{% if message %}

crowdsourcer/templates/crowdsourcer/authority_ror_questions.html

+1-13
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,7 @@ <h1 class="mb-3 mb-md-4">
1313
</h1>
1414

1515
<div class="sticky-top py-3 bg-white border-bottom" style="margin-bottom: -1px;">
16-
<div class="dropdown">
17-
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
18-
Skip to question
19-
</button>
20-
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
21-
{% for q_form in form %}
22-
<li><a class="dropdown-item d-flex" style="max-width: 30em; white-space: normal;" href="#q{{q_form.question_obj.number_and_part}}">
23-
<span style="width: 2em; flex: 0 0 auto;">Q{{q_form.question_obj.number_and_part}}</span>
24-
<span class="text-muted fs-7 ms-3">{{ q_form.question_obj.description }}</span>
25-
</a></li>
26-
{% endfor %}
27-
</ul>
28-
</div>
16+
{% include "crowdsourcer/includes/skip_questions_dropdown.html" with form=form%}
2917
</div>
3018

3119
{% if message %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="dropdown">
2+
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
3+
Skip to question
4+
</button>
5+
<ul class="dropdown-menu" aria-labelledby="navbarDropdown" style="max-height: 60dvh; overflow-y: auto;">
6+
{% for q_form in form %}
7+
<li><a class="dropdown-item d-flex" style="max-width: 30em; white-space: normal;" href="#q{{q_form.question_obj.number_and_part}}">
8+
<span style="width: 2em; flex: 0 0 auto;">Q{{q_form.question_obj.number_and_part}}</span>
9+
<span class="text-muted fs-7 ms-3">{{ q_form.question_obj.description }}</span>
10+
</a></li>
11+
{% endfor %}
12+
</ul>
13+
</div>

0 commit comments

Comments
 (0)