first commit
Build and deploy / build-and-push (push) Successful in 17s
Build and deploy / deploy (push) Successful in 10s

This commit is contained in:
william
2026-08-21 16:23:49 +02:00
committed by william
commit 3f4ebc4527
248 changed files with 10180 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
from flask import render_template, request, redirect, url_for, abort
import db
from core.flask_app import app
@app.route("/game/<slug>/objects/<int:definition_id>/edit", methods=["GET", "POST"])
def object_edit(slug, definition_id):
game = db.game_meta(slug)
definition = db.get_definition(slug, definition_id)
if not definition:
abort(404)
existing_definitions = [d for d in db.list_definitions(slug) if d["id"] != definition_id]
if request.method == "POST":
new_name = request.form.get("object_name", "").strip()
if new_name and new_name != definition["name"]:
db.rename_definition(slug, definition_id, new_name)
return redirect(url_for("object_edit", slug=slug, definition_id=definition_id))
return render_template(
"object_edit.html",
game=game,
definition=definition,
existing_definitions=existing_definitions,
field_types=db.FIELD_TYPES,
)