Skip to content

Commit

Permalink
Add date to ballot and election detail pages
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Aug 24, 2023
1 parent 2b76489 commit 28a713d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ynr/apps/elections/templates/elections/ballot_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

{% block body_class %}constituency{% endblock %}

{% block title %}Candidates for {{ ballot.post.label }} in the {{ ballot.election.name }}{% endblock %}
{% block title %}Candidates for {{ ballot.post.label }} in the {{ ballot.election.name }} on {{ ballot.election.election_date|date:"j F Y" }}{% endblock %}

{% block hero %}
<h1>Candidates for {{ ballot.post.label }}</h1>
<h1>Candidates for {{ ballot.post.label }} on <br>{{ ballot.election.election_date|date:"j F Y" }}</h1>
{% endblock %}


Expand Down
6 changes: 3 additions & 3 deletions ynr/apps/elections/templates/elections/election_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

{% block title %}
{% if ballot.candidates_locked %}
Candidates for each ballot in the {{ object.name }}
Candidates for each ballot in the {{ object.name }} on {{ object.election_date|date:"j F Y" }}
{% else %}
Known candidates for each ballot in the {{ object.name }}
Known candidates for each ballot in the {{ object.name }} on {{ object.election_date|date:"j F Y" }}
{% endif %}
{% endblock %}

Expand Down Expand Up @@ -33,7 +33,7 @@ <h1>{{ object.name }}</h1>

{% for ballot in ballots %}
<h3>
<a href="{{ ballot.get_absolute_url }}">{{ ballot.post.label }}</a>
<a href="{{ ballot.get_absolute_url }}">{{ ballot.post.label }} on {{ object.election_date|date:"j F Y" }}</a>
{{ ballot.cancelled_status_html }}
{{ ballot.locked_status_html }}
</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block body_class %}constituency{% endblock %}
{% block title %}Candidates for {{ object.post.label }} in the {{ object.election.name }}{% endblock %}
{% block title %}Candidates for {{ object.post.label }} in the {{ object.election.name }} on {{ ballot.election.election_date|date:"j F Y" }}{% endblock %}

{% block hero %}
<h1>
Expand Down
4 changes: 3 additions & 1 deletion ynr/apps/elections/tests/test_ballot_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def test_ballot_with_candidates_no_sopn(self):

self.assertEqual(response.context["candidates"].count(), 9)
self.assertDataTimelineCandidateAddingInProgress(response)
self.assertInHTML("<h1>Candidates for Bar Ward</h1>", response.text)
self.assertInHTML(
"<h1>Candidates for Bar Ward on <br>7 Sept 2023</h1>", response.text
)
self.assertInHTML(
"""
<p>
Expand Down

0 comments on commit 28a713d

Please sign in to comment.