summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-11-23 19:20:23 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-11-23 19:20:23 +0800
commit70b5dae19f8a91d13f05f3b39582d50718104d56 (patch)
tree341d9fce73747c9fb61e017470e5bd1f57e22e64
parent542c6ff92f29cb9c83f3c217f29646d25a1a4a20 (diff)
Index page with QR codes
-rw-r--r--jimbrella/static/QR_giveback.pngbin0 -> 2434 bytes
-rw-r--r--jimbrella/static/QR_takeaway.pngbin0 -> 2529 bytes
-rw-r--r--jimbrella/templates/index.html31
-rw-r--r--jimbrella/web.py7
4 files changed, 37 insertions, 1 deletions
diff --git a/jimbrella/static/QR_giveback.png b/jimbrella/static/QR_giveback.png
new file mode 100644
index 0000000..96f2d37
--- /dev/null
+++ b/jimbrella/static/QR_giveback.png
Binary files differ
diff --git a/jimbrella/static/QR_takeaway.png b/jimbrella/static/QR_takeaway.png
new file mode 100644
index 0000000..308cf33
--- /dev/null
+++ b/jimbrella/static/QR_takeaway.png
Binary files differ
diff --git a/jimbrella/templates/index.html b/jimbrella/templates/index.html
new file mode 100644
index 0000000..9e88117
--- /dev/null
+++ b/jimbrella/templates/index.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>JI Umbrella</title>
+ <link rel="stylesheet" href="/static/jimbrella.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </head>
+ <body>
+ <h1>JI Umbrella</h1>
+
+ <div id="container">
+ <h3>Click or scan the QR codes below</h3>
+ <div class="tile-container">
+ <div class="tile blue">
+ <h2 class="banner-heading">Borrow</h2>
+ <a href="https://wj.sjtu.edu.cn/q/aYfDXrqG">
+ <img src="/static/QR_takeaway.png"
+ alt="QR code for borrowing umbrella" class="transparent" />
+ </a>
+ </div>
+ <div class="tile green">
+ <h2 class="banner-heading">Return</h2>
+ <a href="https://wj.sjtu.edu.cn/q/Ai9Hb2XR">
+ <img src="/static/QR_giveback.png"
+ alt="QR code for returning umbrella" class="transparent" />
+ </a>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/jimbrella/web.py b/jimbrella/web.py
index 8a625ac..33e059a 100644
--- a/jimbrella/web.py
+++ b/jimbrella/web.py
@@ -1,5 +1,5 @@
import logging
-from flask import Flask
+from flask import Flask, render_template
from .admin import bp as admin_bp
from .auth import bp as auth_bp
from .config import *
@@ -9,6 +9,11 @@ logging.basicConfig(filename=LOG_PATH, level=logging.DEBUG)
app = Flask("jimbrella")
app.secret_key = FLASK_SECRET_KEY
+
+@app.route("/")
+def index():
+ return render_template("index.html")
+
app.register_blueprint(admin_bp)
app.register_blueprint(auth_bp)