From f92d0009bb1ee4e2970f6c7eb9e3fde58ec0feca Mon Sep 17 00:00:00 2001 From: Antonin Date: Mon, 9 May 2016 17:59:42 +0200 Subject: [PATCH] Confirmation on column removal --- js/app/studs.js | 10 ++++++++++ locale/de.json | 1 + locale/en.json | 1 + locale/es.json | 1 + locale/fr.json | 1 + locale/it.json | 1 + locale/oc.json | 1 + tpl/part/vote_table_classic.tpl | 3 ++- tpl/part/vote_table_date.tpl | 3 ++- 9 files changed, 20 insertions(+), 2 deletions(-) diff --git a/js/app/studs.js b/js/app/studs.js index 4ce106a..61e8a90 100644 --- a/js/app/studs.js +++ b/js/app/studs.js @@ -45,6 +45,16 @@ $(document).ready(function () { $(this).next().removeClass('startunchecked'); }); + $('.remove-column').on('click', function(e){ + var confirmTranslation = $(this).data('remove-confirmation'); + if (confirm(confirmTranslation)) { + return true; + } else { + e.stopPropagation(); + return false + } + }); + var form = $('#comment_form'); form.submit(function(event) { event.preventDefault(); diff --git a/locale/de.json b/locale/de.json index 568adad..ce3101c 100644 --- a/locale/de.json +++ b/locale/de.json @@ -209,6 +209,7 @@ "Back to the poll": "Zurück zur Umfrage", "Add a column": "Spalte hinzufügen", "Remove the column": "Spalte entfernen", + "Confirm removal of the column.": "DE_Confirmer la supression de cette colonne.", "Column removed": "Spalte entfernt", "Choice added": "Alternative hinzugefügt", "Confirm removal of all votes of the poll": "Bestätigen Sie die Entfernung aller Wertungen aus der Umfrage", diff --git a/locale/en.json b/locale/en.json index 9faeed6..6ae4fed 100644 --- a/locale/en.json +++ b/locale/en.json @@ -209,6 +209,7 @@ "Back to the poll": "Back to the poll", "Add a column": "Add a column", "Remove the column": "Remove column", + "Confirm removal of the column.": "Confirm removal of the column.", "Column removed": "Column deleted", "Choice added": "Choice added", "Confirm removal of all votes of the poll": "Confirm removal of all votes", diff --git a/locale/es.json b/locale/es.json index 8eebe58..7d1a56e 100644 --- a/locale/es.json +++ b/locale/es.json @@ -209,6 +209,7 @@ "Back to the poll": "Volver a la encuesta", "Add a column": "Añadir una columna", "Remove the column": "Borrar la columna", + "Confirm removal of the column.": "ES_Confirmer la supression de cette colonne.", "Column removed": "Columna borrado", "Choice added": "Elección añadida", "Confirm removal of all votes of the poll": "Confirma la supresión de todos los votos de la encuesta", diff --git a/locale/fr.json b/locale/fr.json index 9b33af3..e80c610 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -209,6 +209,7 @@ "Back to the poll": "Retour au sondage", "Add a column": "Ajouter une colonne", "Remove the column": "Effacer la colonne", + "Confirm removal of the column.": "Confirmer la supression de cette colonne.", "Column removed": "Colonne supprimée", "Choice added": "Choix ajouté", "Confirm removal of all votes of the poll": "Confirmer la suppression de tous les votes de ce sondage", diff --git a/locale/it.json b/locale/it.json index 06775a5..5a0cabb 100644 --- a/locale/it.json +++ b/locale/it.json @@ -209,6 +209,7 @@ "Back to the poll": "Torna al sondaggio", "Add a column": "Aggiungere una colonna", "Remove the column": "Cancellare la colonna", + "Confirm removal of the column.": "IT_Confirmer la supression de cette colonne.", "Column removed": "Colonna rimossa", "Choice added": "Scelta aggiunto", "Confirm removal of all votes of the poll": "Confermare l'eliminazione di tutti i voti del sondaggio", diff --git a/locale/oc.json b/locale/oc.json index 6f4fcd6..b8f5688 100644 --- a/locale/oc.json +++ b/locale/oc.json @@ -209,6 +209,7 @@ "Back to the poll": "Tornar al sondatge", "Add a column": "Apondre una colomna", "Remove the column": "Suprimir la colomna", + "Confirm removal of the column.": "OC_Confirmer la supression de cette colonne.", "Column removed": "Colomna suprimida", "Choice added": "Causida aponduda", "Confirm removal of all votes of the poll": "Confirmar la supression de totes los vòtes d'aqueste sondatge", diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 4a3c38a..fe6a43e 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -21,7 +21,8 @@ {foreach $slots as $id=>$slot} + data-remove-confirmation="{__('adminstuds', 'Confirm removal of the column.')}" + class="btn btn-link btn-sm remove-column" title="{__('adminstuds', 'Remove the column')} {$slot->title|html}"> {__('Generic', 'Remove')} diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index ccfaf26..7723b17 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -24,7 +24,8 @@ {foreach $slot->moments as $id=>$moment} {__('Generic', 'Remove')}