Skip to content

Commit

Permalink
move alerts details from user page
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascumsille committed Dec 11, 2024
1 parent bd9f0c2 commit 240cb22
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions www/includes/easyparliament/templates/html/alert/_list.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
<h3><?= gettext('Your current email alerts') ?></h3>
<hr>
<h3><?= gettext('Email alerts') ?></h3>

<?php $total_alerts = isset($alerts) ? count($alerts) : 0; ?>
<p><?= sprintf(gettext('You currently have %d email alerts'), $total_alerts) ?></p>

<a href="/alert/" class="button radius">Check here to see your alerts</a>

<ul class="alerts-manage__list">
<?php foreach ($alerts as $alert) { ?>
<li>
<?= sprintf(gettext('When %s'), _htmlspecialchars($alert['criteria'])) ?>.
<form action="<?= $actionurl ?>" method="POST">
<input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>">
<?php if ($alert['status'] == 'unconfirmed') { ?>
<input type="submit" class="button small" name="action" value="<?= gettext('Confirm') ?>">
<?php } elseif ($alert['status'] == 'suspended') { ?>
<input type="submit" class="button small" name="action" value="<?= gettext('Resume') ?>">
<?php } else { ?>
<input type="submit" class="button button--secondary small" name="action" value="<?= gettext('Suspend') ?>">
<input type="submit" class="button button--negative small" name="action" value="<?= gettext('Delete') ?>">
<?php } ?>
</form>
</li>
<?php } ?>
</ul>

<div class="clearfix">
<form action="<?= $actionurl ?>" method="POST" class="pull-right">
<input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>">
<!-- No need to reference $alert['token'] here, as you're deleting all alerts -->
<input type="submit" class="button button--negative small" name="action" value="<?= gettext('Delete All') ?>">
</form>
</div>

0 comments on commit 240cb22

Please sign in to comment.