Add confirmation box before flush

This commit is contained in:
Frederic Guillot 2013-04-06 22:21:16 -04:00
parent 4f9fcfe573
commit b854be546b
3 changed files with 19 additions and 1 deletions

View File

@ -212,6 +212,14 @@ Router\get_action('mark-as-read', function() {
});
Router\get_action('confirm-flush-history', function() {
Response\html(Template\layout('confirm_flush', array(
'menu' => 'history'
)));
});
Router\get_action('flush-history', function() {
Model\flush_read();

View File

@ -0,0 +1,10 @@
<div class="page-header">
<h2>Confirmation</h2>
</div>
<p class="alert alert-info">Do you really want to remove these items from your history?</p>
<div class="form-actions">
<a href="?action=flush-history" class="btn btn-red">Yes</a>
or <a href="?action=history">cancel</a>
</div>

View File

@ -7,7 +7,7 @@
<div class="page-header">
<h2>History</h2>
<ul>
<li><a href="?action=flush-history">flush</a></li>
<li><a href="?action=confirm-flush-history">flush</a></li>
</ul>
</div>