Browse Source

Add confirmation before deleting game

testing
Burathar 4 years ago
parent
commit
db31f8e842
  1. 11
      app/templates/game_owner_dashboard.html

11
app/templates/game_owner_dashboard.html

@ -9,9 +9,7 @@
{% block app_content %} {% block app_content %}
<h1>{{ game.name }} Dashboard</h1> <h1>{{ game.name }} Dashboard</h1>
<a href="{{ url_for('main.delete_game', game_name=game.name) }}"> <button class="btn btn-danger" onclick="deleteGame()">Delete Game</button>
<button class="btn btn-danger">Delete Game</button>
</a>
{% if game.unreviewed_bunny_photos() %} {% if game.unreviewed_bunny_photos() %}
<a href="{{ url_for('main.review_caught_bunny_photos', game_name=game.name) }}"> <a href="{{ url_for('main.review_caught_bunny_photos', game_name=game.name) }}">
<button class="btn btn-primary">Review Bunny Photos</button> <button class="btn btn-primary">Review Bunny Photos</button>
@ -118,5 +116,12 @@
addPlayerMarker(map, players[i]) addPlayerMarker(map, players[i])
} }
//Delete Game button
function deleteGame() {
if (confirm("Are you sure you want to delete this game?")) {
window.location.href = "{{ url_for('main.delete_game', game_name=game.name) }}"
}
}
</script> </script>
{% endblock %} {% endblock %}
Loading…
Cancel
Save