Skip to content

Commit

Permalink
Add more cases for postcode election page
Browse files Browse the repository at this point in the history
  • Loading branch information
symroe committed Mar 4, 2018
1 parent 7fa522e commit 3e4acb2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wcivf/apps/elections/templates/elections/election_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ <h1>{{ object.name }}</h1>

{% if object.election_type != "ref" %}
{% if election.person_set.count %}
<p>We know about <strong>{{ election.person_set.count }}</strong> candidates
<p>{% if object.locked %}There are {% else %}We know about {% endif %}<strong>{{ election.person_set.count }}</strong> candidates
{% if object.in_past %}that stood{% else %}standing{% endif %} for this election,
in <strong>{{ object.post_set.count }}</strong> posts.</p>
{% if not object.in_past %}
{% if not object.in_past and not object.locked %}
<p><a href="{{ object.ynr_link }}">Add more at our candidate crowd-sourcing site</a></p>
{% endif %}
{% else %}
Expand Down
13 changes: 11 additions & 2 deletions wcivf/apps/elections/templates/elections/postcode_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,22 @@ <h2>Your candidates in the {{ postelection.election.name }}</h2>
{{ postelection.post.label }}&nbsp;constituency.
{% else %}
{# Display different messages depending on the number of candidates #}
{# Case: No candidates for a contested election #}
{% if not postelection.people and postelection.contested %}
We don't know of any candidates standing yet, you can
<a href="{{ postelection.ynr_link }}">
help improve this page by adding some information to our database</a>.
{% else %}
You can choose from <strong>{{ postelection.people|length }} candidates</strong>
in the {{ postelection.post.label }} constituency. <a href='#where'>Where do I vote?</a>
{# Case: Candidates and the post is locked #}
{% if postelection.locked %}
You can choose from <strong>{{ postelection.people|length }} candidates</strong>
in the {{ postelection.post.label }} constituency. <a href='#where'>Where do I vote?</a>
{% else %}
{# Case: Candidates and the post is NOT locked (add CTA) #}
We know of <strong>{{ postelection.people|length }} candidate{{postelection.people|pluralize}}</strong>
in the {{ postelection.post.label }} constituency. <a href="{{ postelection.ynr_link }}">
Help improve this page by adding some information to our database</a>.
{% endif %}
{% endif %}
{% endif %}
</p>
Expand Down

0 comments on commit 3e4acb2

Please sign in to comment.