Browse Source

Add Delete Game Button

testing
Burathar 4 years ago
parent
commit
326fa3e926
  1. 2
      app/main/routes.py
  2. 3
      app/templates/game_owner_dashboard.html

2
app/main/routes.py

@ -53,7 +53,7 @@ def delete_game(game_name): @@ -53,7 +53,7 @@ def delete_game(game_name):
if not game.owned_by(current_user):
abort(403)
db.session.delete(game)
for user in game.players:
for user in game.users:
if not user.last_login:
db.session.delete(user)
db.session.commit()

3
app/templates/game_owner_dashboard.html

@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@
{% block app_content %}
<h1>{{ game.name }} Dashboard</h1>
<a href="{{ url_for('main.delete_game', game_name=game.name) }}">
<button class="btn btn-danger">Delete Game</button>
</a>
{% if game.unreviewed_bunny_photos() %}
<a href="{{ url_for('main.review_caught_bunny_photos', game_name=game.name) }}">
<button class="btn btn-primary">Review Bunny Photos</button>

Loading…
Cancel
Save