Marek Baczynski 7 years ago
commit 0f177b816c

@ -213,9 +213,9 @@ def addme():
if current_user.name not in meal.eaters: if current_user.name not in meal.eaters:
meal.eaters.append(current_user.name) meal.eaters.append(current_user.name)
save() save()
return Response('<p>Have a nice meal!</p>') return render_template('appresponse.html', message='Have a nice meal!')
else: else:
return Response('<p>only one meal per person!</p>') return render_template('appresponse.html', message='Only one meal per person!')
#anti-adding to meal #anti-adding to meal
@app.route("/removeme") @app.route("/removeme")
@ -225,9 +225,9 @@ def removeme():
if current_user.name in meal.eaters: if current_user.name in meal.eaters:
meal.eaters.remove(current_user.name) meal.eaters.remove(current_user.name)
save() save()
return '<p>no food for you!</p>' return render_template('appresponse.html', message='No food for you!')
else: else:
return '<p>insert joke here</p>' return render_template('appresponse.html', message='Insert joke here')
# make a new meal # make a new meal
@app.route("/volunteer") @app.route("/volunteer")
@ -237,9 +237,9 @@ def volunteer():
if meal.kuk == '': if meal.kuk == '':
meal.kuk = current_user.name meal.kuk = current_user.name
save() save()
return '<p>we commend you for your bravery!</p>' return render_template('appresponse.html', message='We commend you for your bravery!')
else: else:
return '<p>2 cooks is 1 too many</p>' return render_template('appresponse.html', message='2 cooks is 1 too many!')
# finishing the meal # finishing the meal
@app.route("/finish") @app.route("/finish")
@ -248,7 +248,7 @@ def finish():
meal = Meal.getCurrent() meal = Meal.getCurrent()
meal.account() meal.account()
save() save()
return '<p>Meal closed!</p>' return render_template('appresponse.html', message='Meal closed!')
# make a new meal # make a new meal
@app.route("/plan") @app.route("/plan")
@ -259,7 +259,7 @@ def plan():
# leaders = [p for p in leaderboard if p['score'] == leaderboard[0]['score']] # leaders = [p for p in leaderboard if p['score'] == leaderboard[0]['score']]
# meal.kuk = random.choice(leaders)['name'] + '?' # meal.kuk = random.choice(leaders)['name'] + '?'
save() save()
return '<p>meal waiting!</p>' return render_template('appresponse.html', message='Meal waiting!')
# somewhere to logout # somewhere to logout
@app.route("/logout") @app.route("/logout")

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>The app said</title>
<meta http-equiv="refresh" content="3;url=/" />
</head>
<body>
<p>{{message}}</p>
</body>
</html>

@ -12,6 +12,7 @@
background-position: left top; background-position: left top;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% auto; background-size: 100% auto;
background-color: #aeaeac;
} }
</style> </style>
</head> </head>

Loading…
Cancel
Save