fixed indents

This commit is contained in:
2026-02-01 18:09:31 +01:00
parent e04beb31d2
commit e697a6ee82
+21 -22
View File
@@ -562,32 +562,32 @@ data:
</div> </div>
</body> </body>
</html>""" </html>"""
return Response(content=html, media_type="text/html") return Response(content=html, media_type="text/html")
@APP.get("/userdata/motivation/manage") @APP.get("/userdata/motivation/manage")
def motivation_manage(key: str = "", user: str = "default", accent: str = "5ac8d8"): def motivation_manage(key: str = "", user: str = "default", accent: str = "5ac8d8"):
"""Full-page management interface for motivation quotes.""" """Full-page management interface for motivation quotes."""
expected_key = os.environ.get("GLANCE_HELPER_KEY", "") expected_key = os.environ.get("GLANCE_HELPER_KEY", "")
if key != expected_key: if key != expected_key:
return Response(content="Unauthorized", status_code=401) return Response(content="Unauthorized", status_code=401)
safe_user = re.sub(r'[^a-zA-Z0-9_-]', '', user) or "default" 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" safe_accent = re.sub(r'[^a-fA-F0-9]', '', accent)[:6] or "5ac8d8"
sections = load_userdata(safe_user) sections = load_userdata(safe_user)
quotes = sections.get("Motivation", []) quotes = sections.get("Motivation", [])
# Build quotes list HTML # Build quotes list HTML
quotes_html = "" quotes_html = ""
for i, q in enumerate(quotes): for i, q in enumerate(quotes):
q_escaped = q.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace('"', "&quot;") q_escaped = q.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace('"', "&quot;")
quotes_html += f'''<div class="quote-item" data-index="{i}"> quotes_html += f'''<div class="quote-item" data-index="{i}">
<span class="quote-num">{i+1}.</span> <span class="quote-num">{i+1}.</span>
<span class="quote-text">{q_escaped}</span> <span class="quote-text">{q_escaped}</span>
<button class="quote-delete" onclick="deleteQuote({i})" title="Delete">×</button> <button class="quote-delete" onclick="deleteQuote({i})" title="Delete">×</button>
</div>''' </div>'''
html = f"""<!DOCTYPE html> html = f"""<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@@ -747,7 +747,6 @@ data:
return {"quote": _random.choice(quotes), "total": len(quotes)} return {"quote": _random.choice(quotes), "total": len(quotes)}
return {"quote": "", "total": 0} return {"quote": "", "total": 0}
# ================================ # ================================
# Időkép configuration # Időkép configuration
# ================================ # ================================