Ajout d'un "popup" de confirmation

On vérifie que l'utilisateur a conscience de ce qu'il fait lorsqu'il
supprime un flux ou vide une catégorie
This commit is contained in:
Marien Fressinaud
2013-10-08 11:19:49 +02:00
parent b0809fcf5e
commit c06aede546
5 changed files with 16 additions and 2 deletions

View File

@@ -214,6 +214,8 @@ return array (
'forbidden_access' => 'Forbidden access',
'forbidden_access_description' => 'Access is password protected, please <a class="signin" href="#">sign in</a> to read your feeds.',
'confirm_action' => 'Are you sure you want perform this action? It cannot be canceled!',
// DATE
'january' => 'january',
'february' => 'february',

View File

@@ -214,6 +214,8 @@ return array (
'forbidden_access' => 'Accès interdit',
'forbidden_access_description' => 'Laccès est protégé par un mot de passe, veuillez <a class="signin" href="#">vous connecter</a> pour accéder aux flux.',
'confirm_action' => 'Êtes-vous sûr de vouloir continuer ? Cette action ne peut être annulée !',
// DATE
'january' => 'janvier',
'february' => 'février',

View File

@@ -15,7 +15,7 @@
</label>
<div class="group-controls">
<input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />
<a href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Translate::t ('ask_empty'); ?></a> (<?php echo Translate::t ('number_feeds', $cat->nbFeed ()); ?>)
<a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Translate::t ('ask_empty'); ?></a> (<?php echo Translate::t ('number_feeds', $cat->nbFeed ()); ?>)
<?php if ($cat->id () == $this->defaultCategory->id ()) { ?>
<i class="icon i_help"></i> <?php echo Translate::t ('can_not_be_deleted'); ?>
<?php } ?>
@@ -39,3 +39,5 @@
</div>
</form>
</div>
<?php $this->renderHelper ('confirm_action_script'); ?>

View File

@@ -106,11 +106,14 @@
<div class="form-group form-actions">
<div class="group-controls">
<button class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
<button class="btn btn-attention" formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Translate::t ('delete'); ?></button>
<button class="btn btn-attention confirm" formaction="<?php echo Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Translate::t ('delete'); ?></button>
</div>
</div>
</form>
</div>
<?php $this->renderHelper ('confirm_action_script'); ?>
<?php } else { ?>
<div class="alert alert-warn"><span class="alert-head"><?php echo Translate::t ('no_selected_feed'); ?></span> <?php echo Translate::t ('think_to_add'); ?></div>
<?php } ?>

View File

@@ -0,0 +1,5 @@
<script type="text/javascript">
$('.confirm').click(function () {
return confirm("<?php echo Translate::t('confirm_action'); ?>");
});
</script>