Added code skeleton for opening fridge and tools

master
Davide Bongiovanni 8 years ago
parent 7708e18536
commit b170121643

@ -1,6 +1,6 @@
from functools import wraps from functools import wraps
from flask import Flask from flask import Flask
from flask import render_template, send_from_directory, request, Response from flask import render_template, send_from_directory, request, Response, redirect, url_for
import json, time import json, time
app = Flask(__name__) app = Flask(__name__)
@ -25,18 +25,14 @@ def index():
@app.route('/status') @app.route('/status')
@requires_auth @requires_auth
def somehtml(): def status():
return render_template('status.html') return render_template('status.html')
@app.route('/users') @app.route('/open/<what>')
@requires_auth @requires_auth
def users(): def users(what):
return 'This button is actually useless.' print 'opened', what
return redirect(url_for('status'))
@app.route('/history')
@requires_auth
def history():
return render_template('history.html')
@app.route('/gethistory') @app.route('/gethistory')
@requires_auth @requires_auth

Binary file not shown.

@ -20,9 +20,9 @@
<div class="everything-else"> <div class="everything-else">
<h1>Card access manager</h1> <h1>Card access manager</h1>
<br> <br>
<a href="/users"><div class="big-button">Open fridge</div></a> <a href="/open/fridge"><div class="big-button">Open fridge</div></a>
<br> <br>
<a href="/users"><div class="big-button">Open tools</div></a> <a href="/open/tools"><div class="big-button">Open tools</div></a>
</div> </div>
<div class="shadow" onclick="overlay_out()"></div> <div class="shadow" onclick="overlay_out()"></div>
<div class="overlay"> <div class="overlay">

Loading…
Cancel
Save