Skip to content

Commit

Permalink
Merge pull request #2421 from DemocracyClub/hotfix/reset-home-page
Browse files Browse the repository at this point in the history
Hotfix/reset home page
  • Loading branch information
symroe authored Jul 14, 2024
2 parents 679b53f + 3d5ec57 commit b1ea52e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 34 deletions.
2 changes: 1 addition & 1 deletion deploy/webapp_settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# RESULTS_PROGRESS
# DATA_DOWNLOAD
# BY_ELECTIONS
FRONT_PAGE_CTA = "RESULTS_PROGRESS"
FRONT_PAGE_CTA = "BY_ELECTIONS"
SOPN_TRACKER_INFO = {
"election_date": "2024-07-04",
"election_name": "2024 general election",
Expand Down
14 changes: 6 additions & 8 deletions ynr/apps/elections/uk/templates/candidates/finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ <h1>Open candidate information for UK elections</h1>
{% current_election_stats %}
{% results_progress %}
</div>
</div>

<div class="finder__forms cta-{{ front_page_cta }}">
<div class="finder__forms__container">
{% data_download %}
</div>
</div>

</div>
{% endif %}

<div class="finder__forms cta-{{ front_page_cta }}">
<div class="finder__forms__container">
{% data_download %}
</div>
</div>

{# <div class="finder__forms cta-{{ front_page_cta }}">#}
{# <div class="finder__forms__container">#}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2>Get the data</h2>
<p>Download the CSV of all candidates standing for the 2024 general election:</p>
<p>Download the CSV of all candidates that stood for the 2024 general election:</p>
<p><a class="button" href="{% url 'data_export' %}?election_id=parl.2024-07-04&field_group=results">Download CSV</a></p>
<p>Or for more advance filters and more fields, try the
<a href="{% url 'data_home' %}?election_id=parl.2024-07-04&field_group=results">custom CSV builder</a>.</p>
Expand Down
23 changes: 0 additions & 23 deletions ynr/apps/elections/uk/templatetags/home_page_tags.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime

from candidates.models import Ballot
from data_exports.models import MaterializedMemberships
from django import template
from django.conf import settings
from django.db.models import Count, F, Func, Q, Sum, TextField, Value
Expand Down Expand Up @@ -191,28 +190,6 @@ def results_progress(context):
election__slug="parl.2024-07-04",
)

# TODO: Remove after the General election
context["parl_marked_elected"] = MaterializedMemberships.objects.filter(
ballot_paper__election__election_date=election_date,
ballot_paper__election__slug="parl.2024-07-04",
elected=True,
).count()
context["parl_marked_elected_percent"] = round(
float(context["parl_marked_elected"]) / float(650) * 100
)
context["parl_elected_by_party"] = (
MaterializedMemberships.objects.filter(
ballot_paper__election__election_date=election_date,
ballot_paper__election__slug="parl.2024-07-04",
elected=True,
)
.values("party_name", "party_id")
.annotate(party_count=Count("party_id"))
.order_by("-party_count")
)

# END TODO

context["results_entered"] = ballot_qs.has_results().count()
context["areas_total"] = ballot_qs.count()
try:
Expand Down
2 changes: 1 addition & 1 deletion ynr/settings/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __getitem__(self, item):
ALLOWED_HOSTS = ["candidates.democracyclub.org.uk"]

SHOW_SOPN_TRACKER = False
SHOW_RESULTS_PROGRESS = True
SHOW_RESULTS_PROGRESS = False

ALWAYS_ALLOW_RESULT_RECORDING = False

Expand Down

0 comments on commit b1ea52e

Please sign in to comment.