Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few minor fixes to ballots template #109

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions postcode_lookup/templates/includes/ballots.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
{% for ballot in date.date_data.ballots %}
<div class="ec-ds-section">
{% if not section.response_type.name == "ONE_CURRENT_BALLOT" %}
<div id="{{ ballot.ballot_paper_id }}">
{% if ballot.cancelled %}
{% include 'includes/cancellation_reasons.html' %}
{% else %}
{% if ballot.candidates_verified and section.context.show_candidates %}
<details>
<summary>{{ ballot.election_name }} candidates</summary>
{{ additional_ballot_link(request, ballot) }}
<ol class="candidate-list">
{% if ballot.voting_system.uses_party_lists %}
{% for party_name, candidates in ballot.candidates|groupby('party.party_name') %}
<li>{{ party_name }} ({{ candidates|length }} candidates)</li>
{% endfor %}
{% else %}
{% for candidate in ballot.candidates %}
<li>
{{ candidate.person.name }}<br>
{{ candidate.party.party_name }}
</li>
{% endfor %}
{% endif %}

{% endif %}
{% if ballot.cancelled %}
{% include 'includes/cancellation_reasons.html' %}
{% else %}
{% if ballot.candidates_verified and section.context.show_candidates %}
<details>
<summary id="{{ ballot.ballot_paper_id }}">{{ ballot.election_name }} candidates</summary>
{{ additional_ballot_link(request, ballot) }}
<ol class="candidate-list">
{% if ballot.voting_system.uses_party_lists %}
{% for party_name, candidates in ballot.candidates|groupby('party.party_name') %}
<li>{{ party_name }} ({{ candidates|length }} candidates)</li>
{% endfor %}
{% else %}
{% for candidate in ballot.candidates %}
<li>
{{ candidate.person.name }}<br>
{{ candidate.party.party_name }}
</li>
{% endfor %}
{% endif %}

</ol>
<p><a href="{{ ballot.wcivf_url }}">
Find out more about the candidates in your area on WhoCanIVoteFor.co.uk
</a></p>
</details>
{% else %}
{% trans sopn_date=section.context.sopn_publish_date|date_filter %}
<h3>Candidates</h3>
<p>The list of candidates for this election will be published after {{ sopn_date }}.</p>
{% endtrans %}
{% endif %}
{% endif %}
</ol>
<p><a href="{{ ballot.wcivf_url }}">
Find out more about the candidates in your area on WhoCanIVoteFor.co.uk
</a></p>
</details>
{% else %}
{% trans sopn_date=section.context.sopn_publish_date|date_filter, election_name=ballot.election_name %}
<h3>{{ election_name }} candidates</h3>
<p>The list of candidates for this election will be published after {{ sopn_date }}.</p>
{% endtrans %}
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
Loading