Skip to content

Commit

Permalink
use former MP on front page if commons dissolved
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed May 30, 2024
1 parent ff45950 commit c3be1dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions classes/Homepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ public function display() {
$data = array();

$common = new Common;
$dissolution = Dissolution::dates();

$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['regional'] = $this->getRegionalList();
$data['popular_searches'] = $common->getPopularSearches();
Expand Down
2 changes: 1 addition & 1 deletion www/includes/easyparliament/templates/html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
</div>
<?php } else { ?>
<h1>Find out more about your MP, and election candidates</h1>
<h1>Find out more about your <?php if ($commons_dissolved) { ?>former <?php } ?>MP, and election candidates</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

0 comments on commit c3be1dc

Please sign in to comment.