summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-10-08 11:19:49 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-10-08 11:19:49 +0200
commitc06aede546514aa35ab5369575f15710b30a2a23 (patch)
treeff369a6d90b4848e31158df79bb438bab6b0c9ce
parentb0809fcf5eec9d19f335bbed57102beadefba276 (diff)
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
-rw-r--r--app/i18n/en.php2
-rw-r--r--app/i18n/fr.php2
-rw-r--r--app/views/configure/categorize.phtml4
-rw-r--r--app/views/configure/feed.phtml5
-rw-r--r--app/views/helpers/confirm_action_script.phtml5
5 files changed, 16 insertions, 2 deletions
diff --git a/app/i18n/en.php b/app/i18n/en.php
index 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.php
index 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.phtml
index 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.phtml
index 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.phtml
new file mode 100644
index 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