The "Éléments de cet écran" tree now renders every level of nesting (previously stopped after one level of children) as a compact single-line list, and right-clicking a row opens a context menu to duplicate the element (and its full subtree) in place, in its current container. Also: all property panels start collapsed instead of some being open by default, the redundant nested element list inside "Ajouter DANS ce conteneur" is removed (it only needs the widget picker), and the now-unneeded "a container is selected" warning banner is gone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
15 lines
467 B
Python
15 lines
467 B
Python
from flask import redirect, url_for, abort
|
|
|
|
import screens
|
|
|
|
from core.flask_app import app
|
|
|
|
|
|
@app.route("/game/<slug>/elements/<int:element_id>/duplicate", methods=["POST"])
|
|
def element_duplicate(slug, element_id):
|
|
element = screens.get_element(slug, element_id)
|
|
if not element:
|
|
abort(404)
|
|
new_id = screens.duplicate_element(slug, element_id)
|
|
return redirect(url_for("screen_edit", slug=slug, screen_id=element["screen_id"], selected=new_id))
|