Skip to content

Commit 1348ad9

Browse files
committed
display a list to council minutes, if exists, in question header
Fixes #160
1 parent 75e5aad commit 1348ad9

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

crowdsourcer/models.py

+7
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ def response_counts(
209209

210210
return authorities
211211

212+
def get_data(self, data_name):
213+
try:
214+
data = AuthorityData.objects.get(authority=self, data_name=data_name)
215+
return data.data_value
216+
except AuthorityData.DoesNotExist:
217+
return None
218+
212219
class Meta:
213220
verbose_name_plural = "authorities"
214221

crowdsourcer/templates/crowdsourcer/authority_questions.html

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ <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+
{% if council_minutes %}
17+
<div class="float-end" style="position: relative; z-index: 10;">
18+
<a href="{{ council_minutes }}">Minutes</a>
19+
</div>
20+
{% endif %}
21+
1622
<div class="dropdown">
1723
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
1824
Skip to question

crowdsourcer/templates/crowdsourcer/authority_questions_with_previous.html

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ <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+
{% if council_minutes %}
18+
<div class="float-end" style="position: relative; z-index: 10;">
19+
<a href="{{ council_minutes }}">Minutes</a>
20+
</div>
21+
{% endif %}
22+
1723
<div class="dropdown">
1824
<button class="btn btn-outline-secondary dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
1925
Skip to question

crowdsourcer/views/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def get_context_data(self, **kwargs):
163163
] = f"{self.title_start}{context['authority_name']}: {context['section_title']}"
164164
context["has_previous_questions"] = self.has_previous_questions
165165

166+
context["council_minutes"] = self.authority.get_data("council_minutes")
166167
return context
167168

168169

0 commit comments

Comments
 (0)