Skip to content

Commit

Permalink
Add mobile link to current rep
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Jul 5, 2024
1 parent 4da5e30 commit 2c2b1cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions markdown/post-election.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# The polls are closed!

{{ rep_link }}


The UK general election is now over.

Through Thursday night and into Friday, the votes will be counted, winners announced - and we will be loading the new MPs into TheyWorkForYou.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
</form>
<?php $form = ob_get_clean(); ?>

<?php ob_start(); ?>
<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>
<?php $rep_link = ob_get_clean(); ?>

<?php
$markdown_file = '../../../markdown/post-election.md';
Expand All @@ -21,7 +33,7 @@
$html = $Parsedown->text($text);

$html = str_replace("{{ form }}", $form, $html);

$html = str_replace("{{ rep_link }}", $rep_link , $html);
echo $html;
?>

Expand Down

0 comments on commit 2c2b1cc

Please sign in to comment.