diff --git a/shop.py b/shop.py index 6bed573..f41392d 100644 --- a/shop.py +++ b/shop.py @@ -4,6 +4,8 @@ import sqlite3 import os.path DBNAME = "list.db" +MOBILES = ["android", "iphone", "blackberry"] + def doesDBExist(DBNAME): try: @@ -61,7 +63,10 @@ app.config["DEBUG"] = True @app.route('/') def index(): query = readFromDB() - data = {"title":"Cart", "results":query} + data = {"title":"Shopping List", "results":query} + for device in MOBILES: + if device in request.user_agent.platform: + return render_template('mobile.html', data=data) return render_template('index.html', data=data) @app.route('/post', methods=['POST']) @@ -84,4 +89,4 @@ def handle_data(): if __name__ == '__main__': doesDBExist(DBNAME) - app.run(host="0.0.0.0") \ No newline at end of file + app.run() diff --git a/static/css/index.css b/static/css/main.css similarity index 100% rename from static/css/index.css rename to static/css/main.css diff --git a/templates/index.html b/templates/index.html index 23031da..2c3b0c9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,7 +5,7 @@ - +
| Item | +Requester | +Gottem? | +Remove | +
|---|---|---|---|
| {{x[1]}} | +{{x[4]}} | + +{% if x[3] == 0 %} + + {% else %} + yes + {% endif %} | ++ | +