Skip to content

Commit

Permalink
Include MP picture on /postcode/
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed May 28, 2024
1 parent 7328522 commit 5b6f3fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion www/includes/easyparliament/templates/html/postcode/ge2024.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

<h1>General election</h1>

<p><a href='#current'>See your current representatives</a>
<style>
:target {
background-color: #ffc;
padding: 0.5em;
}
</style>
<p><a href='#current'>See your current <?php
if (isset($mcon) || isset($mreg)) echo 'representatives';
else echo 'MP';
?></a>

<p>There is a UK general election on <strong>4th July 2024</strong>
<?php
Expand Down
10 changes: 9 additions & 1 deletion www/includes/easyparliament/templates/html/postcode/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@

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

list ($image_url, $size) = MySociety\TheyWorkForYou\Utility\Member::findMemberImage($mp['person_id'], true);

?>

</div>
<div class="sidebar">
<div class="block" id="current">
<div class="block">

<div id="current">
<h2><?= gettext('Your representatives') ?></h2>
<ul>
<li>
<?php if ($image_url) { ?>
<img src="<?= $image_url ?>" alt="" align="right">
<?php } ?>
<?php if ($mp['former']) {
printf(gettext('Your former <strong>MP</strong> (Member of Parliament) is <a href="%s">%s</a>, %s'), '/mp/?p=' . $mp['person_id'], $mp['name'], gettext($mp['constituency']));
} else {
Expand Down Expand Up @@ -81,6 +87,8 @@
}
echo '</ul>';

echo '</div>';

include("repexplain.php");

?>
Expand Down

0 comments on commit 5b6f3fa

Please sign in to comment.