summaryrefslogtreecommitdiff
path: root/jimbrella/web.py
diff options
context:
space:
mode:
Diffstat (limited to 'jimbrella/web.py')
-rw-r--r--jimbrella/web.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/jimbrella/web.py b/jimbrella/web.py
index 006c66c..8b45309 100644
--- a/jimbrella/web.py
+++ b/jimbrella/web.py
@@ -1,6 +1,5 @@
from flask import Flask, request, render_template
from .database import Database
-from .utils import group_by_status, find_overdue
from .config import *
db = Database(DATABASE_PATH)
@@ -8,16 +7,16 @@ db = Database(DATABASE_PATH)
app = Flask("jimbrella")
-@app.route("/")
+@app.route("/admin")
def index():
umbrellas = db.read()
- statuses = group_by_status(umbrellas)
+ statuses = Database.group_by_status(umbrellas)
return render_template(
- "index.html",
- total=len(umbrellas),
- available=len(statuses["available"]),
- lent=len(statuses["lent"]),
- overdue=len(find_overdue(umbrellas)),
+ "admin/index.html",
+ umbrellas=umbrellas,
+ available=statuses["available"],
+ lent=statuses["lent"],
+ overdue=Database.find_overdue(statuses["lent"]),
)