Files
encounterflow/battleflow/routes/board.py

23 lines
972 B
Python
Raw Normal View History

2025-11-20 14:40:42 +01:00
from flask import Blueprint, render_template, current_app, Response
board_bp = Blueprint("board", __name__)
FAVICON_SVG = "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect x='4' y='4' width='56' height='56' rx='12' fill='#0b1220'/><polygon points='32,9 38.5,23 54,23 41,32.5 46,50 32,40.5 18,50 23,32.5 10,23 25.5,23' fill='#fde047'/></svg>"
@board_bp.route("/")
def root():
# convenience: redirect to admin with token if configured
from flask import redirect, url_for, current_app
t = current_app.config.get("COMBAT_TOKEN", "changeme")
return redirect(url_for("admin.admin", token=t))
@board_bp.route("/board")
def board():
return render_template("board.html",
name=current_app.config["PRODUCT_NAME"],
subtitle=current_app.config["PRODUCT_SUBTITLE"])
@board_bp.route("/favicon.svg")
def favicon_svg():
return Response(FAVICON_SVG, 200, {"Content-Type": "image/svg+xml"})