]> git.0d.be Git - django-panik-nonstop.git/commitdiff
add confirmation dialog to nonstop switch
authorFrédéric Péters <fpeters@0d.be>
Thu, 14 Jan 2021 18:06:40 +0000 (19:06 +0100)
committerFrédéric Péters <fpeters@0d.be>
Thu, 14 Jan 2021 18:06:40 +0000 (19:06 +0100)
nonstop/templates/nonstop/quick_links.html

index 32ec21d70a91826d5de4c3e02d84ddd4645cd1f4..d30d66baf1a11252a4cf00be966296a88fd011d1 100644 (file)
@@ -29,7 +29,7 @@
  <li><a href="{% url 'nonstop-zones' %}">Paramétrage des zones</a></li>
  <li><a href="{% url 'nonstop-stats' %}">Statistiques</a></li>
  {% if has_switch %}
- <li><a href="{% url 'nonstop-force-switch' %}">Forcer la bascule nonstop</a></li>
+ <li><a class="confirm" href="{% url 'nonstop-force-switch' %}">Forcer la bascule nonstop</a></li>
  {% endif %}
 {% endif %}
 </ul>
@@ -50,6 +50,9 @@ $(function() {
     var url = $(this).data('url');
     $(this).find('> div').load(url);
   });
+  $('a.confirm').on('click', function() {
+    return confirm('Bascule nonstop ?');
+  });
 });
 </script>