Skip to content

Commit

Permalink
Twins page bug fixes
Browse files Browse the repository at this point in the history
- Prevent overwriting of `council` context variable, which was
  causing the incorrect page title to be output.
- Swap council names in empty state messages.
  • Loading branch information
zarino committed Jun 30, 2023
1 parent 3619007 commit fc43d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions caps/templates/caps/twins.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2>{{ council.short_name }}’s climate plans</h2>
</ul>
{% else %}
<p class="px-3 mb-0 text-muted">
(No terms appear in just {{ twin.short_name }}’s plans.)
(No terms appear in just {{ council.short_name }}’s plans.)
</p>
{% endif %}
</ul>
Expand Down Expand Up @@ -144,7 +144,7 @@ <h2>{{ twin.short_name }}’s climate plans</h2>
</ul>
{% else %}
<p class="px-3 mb-0 text-muted">
(No terms appear in just {{ council.short_name }}’s plans.)
(No terms appear in just {{ twin.short_name }}’s plans.)
</p>
{% endif %}
{% if twin.plan_overlap.overlap %}
Expand Down Expand Up @@ -173,7 +173,7 @@ <h2>{{ twin.short_name }}’s climate plans</h2>
</div>
{% else %}
<div class="card-body">
<p>We haven’t found any climate plans or documents for <a href="{% url 'council' council.slug %}">{{ council.name }}</a>. If you know where to find them, <a href="{{ council.feedback_form_url }}">please let us know</a>.</p>
<p>We haven’t found any climate plans or documents for <a href="{% url 'council' twin.slug %}">{{ twin.name }}</a>. If you know where to find them, <a href="{{ twin.feedback_form_url }}">please let us know</a>.</p>
</div>
{% endif %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions caps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@ def get_context_data(self, **kwargs):
council.related_council_keyphrase_intersection()
)
for group in related_councils:
for council in group["councils"]:
council.plan_overlap = related_councils_intersection[council]
for c in group["councils"]:
c.plan_overlap = related_councils_intersection[c]
if group["type"].slug == "composite":
twin = group["councils"][0]
context["twin"] = twin
Expand Down

0 comments on commit fc43d34

Please sign in to comment.