fixed indents
This commit is contained in:
@@ -562,32 +562,32 @@ data:
|
||||
</div>
|
||||
</body>
|
||||
</html>"""
|
||||
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)
|
||||
@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"
|
||||
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", [])
|
||||
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'''<div class="quote-item" data-index="{i}">
|
||||
<span class="quote-num">{i+1}.</span>
|
||||
<span class="quote-text">{q_escaped}</span>
|
||||
<button class="quote-delete" onclick="deleteQuote({i})" title="Delete">×</button>
|
||||
</div>'''
|
||||
# Build quotes list HTML
|
||||
quotes_html = ""
|
||||
for i, q in enumerate(quotes):
|
||||
q_escaped = q.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """)
|
||||
quotes_html += f'''<div class="quote-item" data-index="{i}">
|
||||
<span class="quote-num">{i+1}.</span>
|
||||
<span class="quote-text">{q_escaped}</span>
|
||||
<button class="quote-delete" onclick="deleteQuote({i})" title="Delete">×</button>
|
||||
</div>'''
|
||||
|
||||
html = f"""<!DOCTYPE html>
|
||||
html = f"""<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@@ -747,7 +747,6 @@ data:
|
||||
return {"quote": _random.choice(quotes), "total": len(quotes)}
|
||||
return {"quote": "", "total": 0}
|
||||
|
||||
|
||||
# ================================
|
||||
# Időkép configuration
|
||||
# ================================
|
||||
|
||||
Reference in New Issue
Block a user