diff --git a/glance-system/glance-helper.yaml b/glance-system/glance-helper.yaml index 5b89edb..64e1585 100644 --- a/glance-system/glance-helper.yaml +++ b/glance-system/glance-helper.yaml @@ -562,32 +562,32 @@ data: """ - return Response(content=html, media_type="text/html") + return Response(content=html, media_type="text/html") - @APP.get("/userdata/motivation/manage") - def motivation_manage(key: str = "", user: str = "default", accent: str = "5ac8d8"): - """Full-page management interface for motivation quotes.""" - expected_key = os.environ.get("GLANCE_HELPER_KEY", "") - if key != expected_key: - return Response(content="Unauthorized", status_code=401) - - safe_user = re.sub(r'[^a-zA-Z0-9_-]', '', user) or "default" - safe_accent = re.sub(r'[^a-fA-F0-9]', '', accent)[:6] or "5ac8d8" - - sections = load_userdata(safe_user) - quotes = sections.get("Motivation", []) - - # Build quotes list HTML - quotes_html = "" - for i, q in enumerate(quotes): - q_escaped = q.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) - quotes_html += f'''
- {i+1}. - {q_escaped} - -
''' - - html = f""" + @APP.get("/userdata/motivation/manage") + def motivation_manage(key: str = "", user: str = "default", accent: str = "5ac8d8"): + """Full-page management interface for motivation quotes.""" + expected_key = os.environ.get("GLANCE_HELPER_KEY", "") + if key != expected_key: + return Response(content="Unauthorized", status_code=401) + + safe_user = re.sub(r'[^a-zA-Z0-9_-]', '', user) or "default" + safe_accent = re.sub(r'[^a-fA-F0-9]', '', accent)[:6] or "5ac8d8" + + sections = load_userdata(safe_user) + quotes = sections.get("Motivation", []) + + # Build quotes list HTML + quotes_html = "" + for i, q in enumerate(quotes): + q_escaped = q.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) + quotes_html += f'''
+ {i+1}. + {q_escaped} + +
''' + + html = f""" @@ -747,7 +747,6 @@ data: return {"quote": _random.choice(quotes), "total": len(quotes)} return {"quote": "", "total": 0} - # ================================ # Időkép configuration # ================================