Skip to content

Commit

Permalink
Apply no_alternate_syntax rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Feb 25, 2025
1 parent 70ea538 commit 0e8c080
Show file tree
Hide file tree
Showing 16 changed files with 179 additions and 179 deletions.
40 changes: 20 additions & 20 deletions www/includes/easyparliament/templates/html/alert/postcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,82 @@
<div class="full-page__row">
<div class="full-page__unit">

<h1>Track your <?php if ($data['recent_election']): ?>new<?php endif ?> MP&rsquo;s parliamentary activity</h1>
<h1>Track your <?php if ($data['recent_election']) { ?>new<?php } ?> MP&rsquo;s parliamentary activity</h1>

<?php if (isset($data['confirmation_sent'])): ?>
<?php if (isset($data['confirmation_sent'])) { ?>

<div class="alerts-message alerts-message--confirmation-sent">
<h2>Almost there!</h2>
<p>We just need to check your email address.</p>
<p>Please click the link in the email we just sent you.</p>
</div>

<?php elseif (isset($data['signedup_no_confirm']) || isset($data['confirmation_received'])): ?>
<?php } elseif (isset($data['signedup_no_confirm']) || isset($data['confirmation_received'])) { ?>

<div class="alerts-message alerts-message--confirmation-received">
<h2>Thanks for subscribing!</h2>
<p>You will now receive alerts when your MP speaks or votes in Parliament, or receives an answer to a written question.</p>
<?php if (isset($data['user_signed_in'])): ?>
<?php if (isset($data['user_signed_in'])) { ?>
<p><a href="/alert/" class="button radius">Show my email settings</a></p>
<?php endif ?>
<?php } ?>
</div>

<?php elseif (isset($data['error'])): ?>
<?php } elseif (isset($data['error'])) { ?>
<div class="alerts-message alerts-message--error">
<h2>Something went wrong</h2>
<p>Sorry, we were unable to create this alert. Please <a href="mailto:<?= str_replace('@', '&#64;', CONTACTEMAIL) ?>">let us know</a>. Thanks.</p>
</div>

<?php else: ?>
<?php } else { ?>

<p class="lead">Enter your postcode, and we&rsquo;ll email you every time your MP speaks, votes, or receives a written answer.</p>

<?php if (isset($data['invalid-postcode-or-email'])): ?>
<?php if (isset($data['invalid-postcode-or-email'])) { ?>
<div class="alerts-message alerts-message--error">
<h2>Oops!</h2>
<p>Either we didn't recognize that postcode or your email address wasn't valid.</p>
</div>
<?php endif ?>
<?php } ?>

<?php if (isset($data['bad-constituency'])): ?>
<?php if (isset($data['bad-constituency'])) { ?>
<div class="alerts-message alerts-message--error">
<h2>Oops!</h2>
<p>We can't find an MP for that postcode.</p>
</div>
<?php endif ?>
<?php } ?>

<?php if (isset($data['user_signed_in']) && isset($data['already_signed_up'])): ?>
<?php if (isset($data['user_signed_in']) && isset($data['already_signed_up'])) { ?>
<div class="alerts-message alerts-message--reminder">
<h2>You are already signed up</h2>
<p>You are already receiving alerts when your MP<?= isset($data['mp_name']) ? ', ' . $data['mp_name'] . ',' : '' ?> speaks or votes in Parliament, or receives an answer to a written question.</p>
<p><a href="/alert/" class="button radius">Show my email settings</a></p>
</div>
<?php endif ?>
<?php } ?>

<form class="alerts-form" method="post">
<input type="hidden" name="add-alert" value="1">
<p>
<label for="id_postcode">Your postcode</label>
<?php if (isset($data['postcode'])): ?>
<?php if (isset($data['postcode'])) { ?>
<input type="text" name="postcode" id="id_postcode" value="<?= _htmlentities($data['postcode']) ?>">
<?php else: ?>
<?php } else { ?>
<input type="text" name="postcode" id="id_postcode">
<?php endif ?>
<?php } ?>
</p>
<p>
<label for="id_email">Your email address</label>
<?php if (isset($data['email'])): ?>
<?php if (isset($data['email'])) { ?>
<input type="text" name="email" id="id_email" value="<?= _htmlentities($data['email']) ?>">
<?php else: ?>
<?php } else { ?>
<input type="text" name="email" id="id_email">
<?php endif ?>
<?php } ?>
</p>
<p>
<button type="submit" class="button radius">Set up alerts</button>
</p>
</form>

<?php endif ?>
<?php } ?>

</div>
</div>
Expand Down
32 changes: 16 additions & 16 deletions www/includes/easyparliament/templates/html/alert/update-mp.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<h1>Update your MP</h1>

<?php if (isset($data['already_signed_up'])): ?>
<?php if (isset($data['already_signed_up'])) { ?>
<div class="alerts-message alerts-message--reminder">
<h2>You are already signed up</h2>
<p>You are already receiving alerts when your new MP, <?= $data['mp_name'] ?>, speaks in Parliament or receives an answer to a written question.</p>
<?php if (isset($data['user_signed_in'])): ?>
<?php if (isset($data['user_signed_in'])) { ?>
<p><a href="/alert/" class="button radius">Show my email settings</a></p>
<?php endif ?>
<?php } ?>
</div>
<?php elseif (isset($data['update'])): ?>
<?php } elseif (isset($data['update'])) { ?>

<div class="alerts-message alerts-message--confirmation-sent">
<h2>Confirm your update!</h2>
Expand All @@ -24,50 +24,50 @@
</form>
</div>

<?php elseif (isset($data['signedup_no_confirm']) || isset($data['confirmation_received'])): ?>
<?php } elseif (isset($data['signedup_no_confirm']) || isset($data['confirmation_received'])) { ?>

<div class="alerts-message alerts-message--confirmation-received">
<h2>Thanks for subscribing!</h2>
<p>You will now receive alerts when your MP speaks in Parliament or receives an answer to a written question.</p>
<?php if (isset($data['user_signed_in'])): ?>
<?php if (isset($data['user_signed_in'])) { ?>
<p><a href="/alert/" class="button radius">Show my email settings</a></p>
<?php endif ?>
<?php } ?>
</div>

<?php elseif (isset($data['error'])): ?>
<?php } elseif (isset($data['error'])) { ?>
<div class="alerts-message alerts-message--error">
<h2>Something went wrong</h2>
<p>Sorry, we were unable to create this alert. Please try again <a href="/alert/by-postcode/">using your postcode</a>. Thanks.</p>
</div>

<?php else: ?>
<?php } else { ?>

<p class="lead">Enter your postcode, and we&rsquo;ll email you every time your MP speaks or receives a written answer.</p>

<form class="alerts-form" action="/alerts/by-postcode/" method="post">
<input type="hidden" name="add-alert" value="1">
<p>
<label for="id_postcode">Your postcode</label>
<?php if (isset($data['postcode'])): ?>
<?php if (isset($data['postcode'])) { ?>
<input type="text" name="postcode" id="id_postcode" value="<?= _htmlentities($data['postcode']) ?>">
<?php else: ?>
<?php } else { ?>
<input type="text" name="postcode" id="id_postcode">
<?php endif ?>
<?php } ?>
</p>
<p>
<label for="id_email">Your email address</label>
<?php if (isset($data['email'])): ?>
<?php if (isset($data['email'])) { ?>
<input type="text" name="email" id="id_email" value="<?= _htmlentities($data['email']) ?>">
<?php else: ?>
<?php } else { ?>
<input type="text" name="email" id="id_email">
<?php endif ?>
<?php } ?>
</p>
<p>
<button type="submit" class="button radius">Set up alerts</button>
</p>
</form>

<?php endif ?>
<?php } ?>

</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions www/includes/easyparliament/templates/html/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
<div class="medium-4 columns">
<nav class="mysoc-footer__links">
<ul>
<?php foreach ($footer_links['about'] as $footer_link): ?>
<?php foreach ($footer_links['about'] as $footer_link) { ?>
<li role="presentation"><a href="<?= $footer_link['href'] ?>" title="<?= $footer_link['title'] ?>" class="<?= $footer_link['classes'] ?>"><?= $footer_link['text'] ?></a></li>
<?php endforeach; ?>
<?php } ?>
</ul>
<ul>
<?php foreach ($footer_links['tech'] as $footer_link): ?>
<?php foreach ($footer_links['tech'] as $footer_link) { ?>
<li role="presentation"><a href="<?= $footer_link['href'] ?>" title="<?= $footer_link['title'] ?>" class="<?= $footer_link['classes'] ?>"><?= $footer_link['text'] ?></a></li>
<?php endforeach; ?>
<?php } ?>
</ul>
</nav>
</div>
Expand Down
16 changes: 8 additions & 8 deletions www/includes/easyparliament/templates/html/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<meta charset="utf-8">
<title><?= strip_tags($page_title) ?></title>
<meta name="viewport" content="initial-scale=1">
<?php if (isset($meta_description)): ?>
<?php if (isset($meta_description)) { ?>
<meta name="description" content="<?= _htmlentities($meta_description) ?>">
<?php endif; ?>
<?php } ?>
<meta name="keywords" content="<?= _htmlentities($meta_keywords); ?>">
<?php
if (!empty($robots)) {
Expand Down Expand Up @@ -43,15 +43,15 @@

<script>document.documentElement.className = 'js';</script>

<?php foreach ($header_links as $link): ?>
<?php foreach ($header_links as $link) { ?>
<link rel="<?= $link['rel'] ?>" title="<?= $link['title'] ?>" href="<?= $link['href'] ?>">
<?php endforeach; ?>
<?php } ?>

<link rel="stylesheet" href="<?= cache_version("style/stylesheets/app.css") ?>" type="text/css">

<?php if (isset($page_rss_url)): ?>
<?php if (isset($page_rss_url)) { ?>
<link rel="alternate" type="application/rss+xml" title="TheyWorkForYou RSS" href="<?= $page_rss_url ?>">
<?php endif; ?>
<?php } ?>

<link rel="apple-touch-icon" href="/images/apple-touch-60.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-touch-76.png" />
Expand All @@ -60,7 +60,7 @@

<script async src="<?= cache_version("js/loading-attribute-polyfill.min.js") ?>"></script>

<?php if (!DEVSITE): ?>
<?php if (!DEVSITE) { ?>

<!-- Google tag (gtag.js) -->
<script defer>Object.defineProperty(document,"cookie",{get:function(){var t=Object.getOwnPropertyDescriptor(Document.prototype,"cookie").get.call(document);return t.trim().length>0&&(t+="; "),t+="_ga=GA1.1."+Math.floor(1e9*Math.random())+"."+Math.floor(1e9*Math.random())},set:function(t){t.trim().startsWith("_ga")||Object.getOwnPropertyDescriptor(Document.prototype,"cookie").set.call(document,t)}});</script>
Expand All @@ -84,7 +84,7 @@ function gtag(){dataLayer.push(arguments);}
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<?php endif; ?>
<?php } ?>

</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (in_array(HOUSE_TYPE_COMMONS, $houses)): ?>
<?php if (in_array(HOUSE_TYPE_COMMONS, $houses)) { ?>
<a name="covid-19"></a>
<div class="panel panel--highlight panel--covid19">
<h2>As a result of COVID-19, some MPs were less able to vote in Parliament in certain periods, and this will be reflected by absences in their voting record.</h2>
Expand All @@ -21,4 +21,4 @@
</dl>
<p> <a href="https://www.mysociety.org/2020/07/06/parliamentary-votes-during-covid-19/">See more detail on votes during the COVID-19 period here.</a></p>
</div>
<?php endif; ?>
<?php } ?>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="person-navigation">
<ul>
<li <?php if ($pagetype == ""): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>"><?= gettext('Overview') ?></a></li>
<?php if ($this_page == "mp"): ?>
<li <?php if ($pagetype == "votes"): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>/votes"><?= gettext('Voting Summary') ?></a></li>
<?php endif; ?>
<?php if (in_array($this_page, ["mp", "msp", "ms"])): ?>
<li <?php if ($pagetype == "recent"): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>/recent"><?= gettext('Recent Votes') ?></a></li>
<?php if ($register_interests): ?>
<li <?php if ($pagetype == "register"): ?>class="active"<?php endif; ?>><a href="<?= $member_url ?>/register"><?= gettext('Register of Interests') ?></a></li>
<?php endif; ?>
<?php endif; ?>
<li <?php if ($pagetype == "") { ?>class="active"<?php } ?>><a href="<?= $member_url ?>"><?= gettext('Overview') ?></a></li>
<?php if ($this_page == "mp") { ?>
<li <?php if ($pagetype == "votes") { ?>class="active"<?php } ?>><a href="<?= $member_url ?>/votes"><?= gettext('Voting Summary') ?></a></li>
<?php } ?>
<?php if (in_array($this_page, ["mp", "msp", "ms"])) { ?>
<li <?php if ($pagetype == "recent") { ?>class="active"<?php } ?>><a href="<?= $member_url ?>/recent"><?= gettext('Recent Votes') ?></a></li>
<?php if ($register_interests) { ?>
<li <?php if ($pagetype == "register") { ?>class="active"<?php } ?>><a href="<?= $member_url ?>/register"><?= gettext('Register of Interests') ?></a></li>
<?php } ?>
<?php } ?>
</ul>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if (in_array(HOUSE_TYPE_COMMONS, $houses)): ?>
<?php if (in_array(HOUSE_TYPE_COMMONS, $houses)) { ?>
<a name="stale-data-warning"></a>
<div class="panel panel--highlight">

Expand All @@ -8,4 +8,4 @@
</p>

</div>
<?php endif; ?>
<?php } ?>
8 changes: 4 additions & 4 deletions www/includes/easyparliament/templates/html/mp/divisions.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@

<div class="primary-content__unit">

<?php if ($party == 'Sinn Féin' && in_array(HOUSE_TYPE_COMMONS, $houses)): ?>
<?php if ($party == 'Sinn Féin' && in_array(HOUSE_TYPE_COMMONS, $houses)) { ?>
<div class="panel">
<p>Sinn F&eacute;in MPs do not take their seats in Parliament.</p>
</div>
<?php endif; ?>
<?php } ?>

<?php $displayed_votes = false; ?>

Expand Down Expand Up @@ -236,11 +236,11 @@

<?php } ?>

<?php if ($profile_message): ?>
<?php if ($profile_message) { ?>
<div class="panel panel--profile-message">
<p><?= $profile_message ?></p>
</div>
<?php endif; ?>
<?php } ?>

<?php if (!$displayed_votes) { ?>

Expand Down
4 changes: 2 additions & 2 deletions www/includes/easyparliament/templates/html/mp/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<ul>

<?php foreach ($mps as $mp): ?>
<?php foreach ($mps as $mp) { ?>
<li><a href="<?= $mp['url'] ?>"><?= $mp['name'] ?></a></li>
<?php endforeach; ?>
<?php } ?>

</ul>

Expand Down
Loading

0 comments on commit 0e8c080

Please sign in to comment.