Skip to content

Commit

Permalink
WIP using new area page for area page
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Dec 12, 2023
1 parent 85fc5c5 commit e1e8a85
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 288 deletions.
49 changes: 49 additions & 0 deletions hub/templates/hub/area/_json_data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% load humanize %}
{% if dataset.name.lower == "results of last election" %}
<table class="table mb-0">
<thead>
<tr>
<th scope="col">Party</th>
<th scope="col">Votes</th>
</tr>
</thead>
<tbody>
{% for data in dataset.data.value.results|dictsortreversed:"votes" %}
{% if data.votes != 0 %}
<tr>
<th>{{ data.party }}</th>
<td>{{ data.votes }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% elif dataset.name.lower == "popular petitions" %}
<table class="table mb-0">
<thead>
<tr>
<th scope="col">Petition</th>
<th scope="col">Signatures</th>
</tr>
</thead>
<tbody>
{% for petition in dataset.data.value %}
<tr>
<td><a href="{{ petition.url }}">{{ petition.action }}</a></td>
<td class="text-end">{{ petition.signatures }}</td>
</tr>
{% endfor %}
</body>
</table>
{% elif dataset.subcategory == "groups" %}
<h6 class="text-muted fw-bold">{{ dataset.label }}</h6>
<ul class="tag-cloud">
{% for data in dataset.data.json %}
{% if data.url %}
<li><a href="{{ data.url }}" class="tag" title="{{ dataset.label }}">{{ data.group_name }}</a></li>
{% else %}
<li class="tag">{{ data.group_name }}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
Loading

0 comments on commit e1e8a85

Please sign in to comment.