Skip to content

Commit

Permalink
fixup: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Dec 13, 2023
1 parent 82a80f0 commit 8470792
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion hub/templates/hub/new_area_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="mb-2">{{ area.name }}</h1>
<div class="container">
<ul class="nav nav-tabs">
<li class="nav-item d-none js-nav-item-featured">
<a class="nav-link" href="{% url 'new_area' %}">Quick facts</a>
<a class="nav-link" href="">Quick facts</a>
</li>
<li class="nav-item d-none js-nav-item-favourites">
<a class="nav-link" href="#favourites">
Expand Down Expand Up @@ -315,6 +315,11 @@ <h3 class="h5">{{ dataset.label }}</h3>
{% include 'hub/area/_json_data.html' with dataset=dataset %}
{% elif dataset.data_type == "text" %}
<p class="card-text mb-0 display-6 lh-1 text-primary">{{ dataset.data.value|safe }}</p>
{% elif dataset.data_type == "integer" %}
<p class="card-text mb-0 display-6 lh-1 text-primary">{{ dataset.data.value }}</p>
{% if data.data.average %}
<p class="card-text mt-2 text-muted">{{dataset.data.average|floatformat }} national average</p>
{% endif %}
{% elif dataset.is_range %}
<table class="table mb-0">
<thead>
Expand Down
4 changes: 2 additions & 2 deletions hub/views/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def get_context_data(self, **kwargs):
context["indexed_categories"] = indexed_categories

try:
context["country"] = indexed_categories["place"]["country"]["data"].value()
except ValueError:
context["country"] = indexed_categories["country"]["data"].value()
except (ValueError, KeyError):
context["country"] = None

return context
Expand Down

0 comments on commit 8470792

Please sign in to comment.