A free, self-hostable news aggregator…
Ajout d'un "popup" de confirmation
Marien Fressinaudc06aede54651
diff --git a/app/i18n/en.php b/app/i18n/en.phpindex bd5c7290f..2cd415deb 100644--- a/app/i18n/en.php+++ b/app/i18n/en.php@@ -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',diff --git a/app/i18n/fr.php b/app/i18n/fr.phpindex 17a0fb702..fac1ac4f8 100644--- a/app/i18n/fr.php+++ b/app/i18n/fr.php@@ -214,6 +214,8 @@ return array ('forbidden_access' => 'Accès interdit','forbidden_access_description' => 'L’accè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',diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtmlindex b6ba5c3c7..9dac49ff8 100644--- a/app/views/configure/categorize.phtml+++ b/app/views/configure/categorize.phtml@@ -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'); ?>diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtmlindex 43bcd64b9..49e2f3cf1 100644--- a/app/views/configure/feed.phtml+++ b/app/views/configure/feed.phtml@@ -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 } ?>diff --git a/app/views/helpers/confirm_action_script.phtml b/app/views/helpers/confirm_action_script.phtmlnew file mode 100644index 000000000..f77006fcc--- /dev/null+++ b/app/views/helpers/confirm_action_script.phtml@@ -0,0 +1,5 @@+<script type="text/javascript">+ $('.confirm').click(function () {+ return confirm("<?php echo Translate::t('confirm_action'); ?>");+ });+</script>\ No newline at end of file