diff --git a/web/app.py b/web/app.py index ab8d02e..225d812 100644 --- a/web/app.py +++ b/web/app.py @@ -32,6 +32,12 @@ def get_db_connection(): conn.row_factory = sqlite3.Row return conn +def get_db_cursor(): + """Get a database cursor.""" + if not hasattr(get_db_cursor, 'conn'): + get_db_cursor.conn = get_db_connection() + return get_db_cursor.conn.cursor() + @app.errorhandler(HTTPException) def handle_exception(error): return render_template("_error.html", error=error), error.code @@ -87,6 +93,16 @@ def about(): def submit_character(): return render_template('submit.html') +@app.route('/players') +def player_list(): + # Replace with your actual player fetching logic + + cursor = get_db_cursor() + cursor.execute('SELECT * FROM players') + players = cursor.fetchall() + if not players: + return render_template('player_list.html', players=[]) + return render_template('player_list.html', players=players) if __name__ == '__main__': app.run(host=config.BIND_ADDRESS, port=config.WEB_PORT, debug=True) diff --git a/web/templates/_base.html b/web/templates/_base.html index f025c75..68e15ee 100644 --- a/web/templates/_base.html +++ b/web/templates/_base.html @@ -28,10 +28,20 @@ along with this program. If not, see https://www.gnu.org/licenses/. {% endif %} | Kemoverse +
A gacha in the fediverse.
+ +This is a playful Misskey-themed gacha tracker made with Flask and SQLite.
+Kemoverse is a simple web app designed to track gacha pulls and player stats in a fun, competitive way.
All rolls are stored, stats are tracked, and characters are added manually for now.
Built with love, chaos, and way too much caffeine ☕.
← Back to Home diff --git a/web/templates/index.html b/web/templates/index.html index a39144d..a20cc2f 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -18,10 +18,7 @@ along with this program. If not, see https://www.gnu.org/licenses/. {% extends "_base.html" %} -{% block header %} -Track your luck. Compare your pulls. Compete with friends.
-{% endblock %} + {% block content %} diff --git a/web/templates/player_list.html b/web/templates/player_list.html new file mode 100644 index 0000000..7fe9145 --- /dev/null +++ b/web/templates/player_list.html @@ -0,0 +1,41 @@ + +{% extends "_base.html" %} + +{% block title %}Player List{% endblock %} + +{% block content %} +No players found.
+{% endif %} +{% endblock %} + +{% block footer_extra %} +Player list is dynamically generated from the database.
+{% endblock %} \ No newline at end of file