feat: object words in right sidebar + design dropdown
- Words panel moved to right sidebar: shows selected object's words or pending words for new object - Pending words auto-saved to object after creation - Remove word chips from left sidebar object cards - Design dropdown in left sidebar (above Fertigstellen), loads choices dynamically from Directus field metadata - Include design field in db_pictures GET response Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
12
app.py
12
app.py
@@ -1710,10 +1710,20 @@ def _find_or_create_db_word(titel_de: str, level: int, token: str) -> tuple:
|
||||
def directus_db_pictures():
|
||||
token = request.headers.get("Authorization", "")
|
||||
pic_status = request.args.get("status", "draft")
|
||||
data, status = _directus("GET", f"/items/db_pictures?filter[status][_eq]={pic_status}&fields=id,picture,blurhash,status&sort=date_created", token)
|
||||
data, status = _directus("GET", f"/items/db_pictures?filter[status][_eq]={pic_status}&fields=id,picture,blurhash,status,design&sort=date_created", token)
|
||||
return jsonify(data), status
|
||||
|
||||
|
||||
@app.route("/api/directus/db-pictures/design-options", methods=["GET"])
|
||||
def directus_db_pictures_design_options():
|
||||
token = request.headers.get("Authorization", "")
|
||||
data, status = _directus("GET", "/fields/db_pictures/design", token)
|
||||
if status != 200:
|
||||
return jsonify({"choices": []}), 200
|
||||
choices = (data.get("data") or data).get("meta", {}).get("options", {}).get("choices", [])
|
||||
return jsonify({"choices": choices})
|
||||
|
||||
|
||||
@app.route("/api/directus/db-pictures/<pic_id>", methods=["PATCH"])
|
||||
def directus_db_picture_patch(pic_id):
|
||||
token = request.headers.get("Authorization", "")
|
||||
|
||||
Reference in New Issue
Block a user