diff --git a/WebHostLib/landing.py b/WebHostLib/landing.py index 3bc3488b..d06a978d 100644 --- a/WebHostLib/landing.py +++ b/WebHostLib/landing.py @@ -1,8 +1,10 @@ from flask import render_template from WebHostLib import app, cache +from .models import * +from datetime import timedelta - -@cache.memoize(timeout=300) @app.route('/', methods=['GET', 'POST']) +@cache.cached(timeout=300) # cache has to appear under app route for caching to work def landing(): - return render_template("landing.html") + multiworlds = count(room for room in Room if room.creation_time >= datetime.utcnow() - timedelta(days=7)) + return render_template("landing.html", multiworlds=multiworlds) diff --git a/WebHostLib/templates/landing.html b/WebHostLib/templates/landing.html index a58fd524..453bdbad 100644 --- a/WebHostLib/templates/landing.html +++ b/WebHostLib/templates/landing.html @@ -35,6 +35,7 @@

This website is under active development. As such, your hosted rooms may occasionally disappear, and there may be bugs. If you do happen to find a bug, please report it here.

+

{{ multiworlds }} games were started in the last 7 days.