Skip to content

Commit

Permalink
[2024] Remove election-time specific code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jul 5, 2024
1 parent 83f92c2 commit 0f62bbd
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 160 deletions.
5 changes: 0 additions & 5 deletions classes/Homepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ public function display() {
$common = new Common;
$dissolution = Dissolution::dates();

// temp for 2024 election
$now = new \DateTime();
$election_date = new \DateTime('2024-07-04 22:00:00');

$data['debates'] = $this->getDebatesData();

$user = new User();
$data['mp_data'] = $user->getRep($this->cons_type, $this->mp_house);
$data["commons_dissolved"] = isset($dissolution[1]);
$data["after_election"] = $now > $election_date;

$data['regional'] = $this->getRegionalList();
$data['popular_searches'] = $common->getPopularSearches();
Expand Down
5 changes: 0 additions & 5 deletions www/docs/postcode/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

// handling to switch the GE message based either on time or a query string

$now = new DateTime();
$election_date = new DateTime('2024-07-04 22:00:00');

$data['post_election_message'] = (($now > $election_date) || (get_http_var("post_election") == 1));

$pc = get_http_var('pc');
if (!$pc) {
postcode_error('Please supply a postcode!');
Expand Down
6 changes: 1 addition & 5 deletions www/includes/easyparliament/templates/html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
</div>
</div>
<?php } else { ?>
<?php if ($after_election === true) { ?>
<h1>Find out more about your new MP</h1>
<?php } else { ?>
<h1>Find out more about your <?php if ($commons_dissolved) { ?>former <?php } ?>MP, and election candidates</h1>
<?php } ?>
<h1>Find out more about your <?php if ($commons_dissolved) { ?>former <?php } ?>MP</h1>
<div class="row collapse">
<form action="/postcode/" class="mp-search__form" onsubmit="trackFormSubmit(this, 'PostcodeSearch', 'Submit', 'Home'); return false;">
<label for="postcode">Your postcode</label>
Expand Down
140 changes: 0 additions & 140 deletions www/includes/easyparliament/templates/html/postcode/ge2024.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ function member_image_box(string $person_id, string $person_url, string $person_
}
}

if ($post_election_message) {
include "ge2024-post-election.php";
} else {
include "ge2024.php";
};
include "ge2024-post-election.php";

# The below is normally the main column, but for now let us make it the sidebar...

Expand Down

0 comments on commit 0f62bbd

Please sign in to comment.