editor.py aktualisiert

This commit is contained in:
2026-10-02 16:55:56 +02:00
parent c141676772
commit 173522d239
+46 -2
View File
@@ -37,6 +37,8 @@ EDIT_PAGE_HEADING = os.environ.get("EDIT_PAGE_HEADING", "Aufnahme bearbeiten")
THEME_FILE = Path(os.environ.get("THEME_FILE", "/config/theme.json")) THEME_FILE = Path(os.environ.get("THEME_FILE", "/config/theme.json"))
LOGO_FILE = Path(os.environ["LOGO_FILE"]) if os.environ.get("LOGO_FILE") else None LOGO_FILE = Path(os.environ["LOGO_FILE"]) if os.environ.get("LOGO_FILE") else None
FAVICON_FILE = Path(os.environ["FAVICON_FILE"]) if os.environ.get("FAVICON_FILE") else None FAVICON_FILE = Path(os.environ["FAVICON_FILE"]) if os.environ.get("FAVICON_FILE") else None
GIT_REPO_URL = os.environ.get("GIT_REPO_URL", "")
USER_URL = os.environ.get("USER_URL", "")
DEFAULT_THEME = {'background': '#111', 'surface': '#181818', 'surface_alt': '#222', 'surface_dark': '#0b0b0b', 'text': '#eee', 'text_secondary': '#ccc', 'text_muted': '#aaa', 'text_faint': '#777', 'border': '#333', 'border_subtle': '#2b2b2b', 'control': '#333', 'control_hover': '#444', 'primary': '#1769aa', 'primary_hover': '#1f7fc2', 'accent': '#ffcc33', 'success': '#173d24', 'success_text': '#b8f5c9', 'warning': '#6b4e00', 'danger': '#8b0000', 'danger_soft': '#4a2020', 'danger_soft_hover': '#6a2b2b', 'error': '#4a1b1b', 'error_text': '#ffd0d0', 'recording': '#b00000', 'recording_border': '#3a2222', 'selection': 'rgba(80,150,255,.16)', 'shadow': '#000', 'scroll_thumb': '#777', 'scroll_thumb_hover': '#999', 'scroll_thumb_active': '#aaa', 'live_surface': '#1d1111', 'table_header': '#252525', 'table_text': '#eee', 'footer': '#666', 'white': '#fff','surface_modal':'#202020','overlay':'rgba(0,0,0,.78)'} DEFAULT_THEME = {'background': '#111', 'surface': '#181818', 'surface_alt': '#222', 'surface_dark': '#0b0b0b', 'text': '#eee', 'text_secondary': '#ccc', 'text_muted': '#aaa', 'text_faint': '#777', 'border': '#333', 'border_subtle': '#2b2b2b', 'control': '#333', 'control_hover': '#444', 'primary': '#1769aa', 'primary_hover': '#1f7fc2', 'accent': '#ffcc33', 'success': '#173d24', 'success_text': '#b8f5c9', 'warning': '#6b4e00', 'danger': '#8b0000', 'danger_soft': '#4a2020', 'danger_soft_hover': '#6a2b2b', 'error': '#4a1b1b', 'error_text': '#ffd0d0', 'recording': '#b00000', 'recording_border': '#3a2222', 'selection': 'rgba(80,150,255,.16)', 'shadow': '#000', 'scroll_thumb': '#777', 'scroll_thumb_hover': '#999', 'scroll_thumb_active': '#aaa', 'live_surface': '#1d1111', 'table_header': '#252525', 'table_text': '#eee', 'footer': '#666', 'white': '#fff','surface_modal':'#202020','overlay':'rgba(0,0,0,.78)'}
@@ -73,6 +75,8 @@ def branding_context():
"theme_css": theme_css(), "theme_css": theme_css(),
"logo_url": "/branding/logo" if LOGO_FILE and LOGO_FILE.is_file() else None, "logo_url": "/branding/logo" if LOGO_FILE and LOGO_FILE.is_file() else None,
"favicon_url": "/branding/favicon" if FAVICON_FILE and FAVICON_FILE.is_file() else None, "favicon_url": "/branding/favicon" if FAVICON_FILE and FAVICON_FILE.is_file() else None,
"git_repo_url": GIT_REPO_URL,
"user_url": USER_URL,
} }
NORMALIZE = os.environ.get("NORMALIZE", "true").lower() not in ("0", "false", "no") NORMALIZE = os.environ.get("NORMALIZE", "true").lower() not in ("0", "false", "no")
@@ -869,6 +873,11 @@ EDITOR_HTML = """
.site-logo { max-width:140px; max-height:48px; object-fit:contain; display:block; flex:0 0 auto; } .site-logo { max-width:140px; max-height:48px; object-fit:contain; display:block; flex:0 0 auto; }
.edit-logo { width:80px !important; height:28px !important; max-width:80px !important; max-height:28px !important; min-width:80px; min-height:28px; object-fit:contain !important; display:block !important; margin:0 0 10px 0; } .edit-logo { width:80px !important; height:28px !important; max-width:80px !important; max-height:28px !important; min-width:80px; min-height:28px; object-fit:contain !important; display:block !important; margin:0 0 10px 0; }
.site-header h1 { margin:0; } .site-header h1 { margin:0; }
.footer { margin-top:24px; color:var(--color-footer); font-size:13px; text-align:center; }
.footer-links { display:flex; justify-content:center; align-items:center; gap:16px; margin-top:8px; }
.footer-links a { color:var(--color-footer); text-decoration:none; }
.footer-links a:hover { color:var(--color-text); text-decoration:underline; }
.git-icon { display:inline-block; margin-right:4px; font-size:16px; line-height:1; }
body { margin:0; padding:24px; background:var(--color-background); color:var(--color-text); font-family:Arial,Helvetica,sans-serif; } body { margin:0; padding:24px; background:var(--color-background); color:var(--color-text); font-family:Arial,Helvetica,sans-serif; }
.container { max-width:1400px; margin:0 auto; } .container { max-width:1400px; margin:0 auto; }
h1 { margin:0 0 6px; font-size:28px; } h1 { margin:0 0 6px; font-size:28px; }
@@ -1346,6 +1355,21 @@ async function submitWithMetadata() {
} }
render(); render();
</script> </script>
<div class="footer">
{% if git_repo_url or user_url %}
<div class="footer-links">
{% if git_repo_url %}
<a href="{{ git_repo_url }}" target="_blank" rel="noopener noreferrer">
<span class="git-icon" aria-hidden="true">⎇</span> App auf Git
</a>
{% endif %}
{% if user_url %}
<a href="{{ user_url }}">Benutzerseite</a>
{% endif %}
</div>
{% endif %}
</div>
</body> </body>
</html> </html>
""" """
@@ -1365,9 +1389,9 @@ INDEX_HTML = """
body { margin:0; padding:24px; background:var(--color-background); color:var(--color-text); font-family:Arial,Helvetica,sans-serif; } body { margin:0; padding:24px; background:var(--color-background); color:var(--color-text); font-family:Arial,Helvetica,sans-serif; }
.container { max-width:1400px; margin:0 auto; } .container { max-width:1400px; margin:0 auto; }
h1 { margin:0 0 6px; } h1 { margin:0 0 6px; }
.site-header { display:flex; align-items:center; gap:18px; margin-bottom:24px; flex-wrap:wrap; } .site-header { display:flex; align-items:center; gap:18px; margin-bottom:24px; flex-wrap:nowrap; }
.site-logo { max-width:140px; max-height:48px; object-fit:contain; display:block; flex:0 0 auto; } .site-logo { max-width:140px; max-height:48px; object-fit:contain; display:block; flex:0 0 auto; }
.site-header h1 { margin:0; } .site-header h1 { margin:0; flex:1 1 auto; min-width:0; }
.subtitle { color:var(--color-text-muted); margin-bottom:22px; } .subtitle { color:var(--color-text-muted); margin-bottom:22px; }
.section { background:var(--color-surface-dark); color:var(--color-white); border:1px solid var(--color-primary); border-radius:8px; padding:16px; margin:0 0 24px 0; box-shadow:0 2px 6px var(--color-shadow); } .section { background:var(--color-surface-dark); color:var(--color-white); border:1px solid var(--color-primary); border-radius:8px; padding:16px; margin:0 0 24px 0; box-shadow:0 2px 6px var(--color-shadow); }
.filter-bar { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:10px; margin-bottom:14px; } .filter-bar { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
@@ -1388,6 +1412,11 @@ th { color:var(--color-text-muted); font-weight:normal; }
.button { display:inline-flex; align-items:center; justify-content:center; height:42px; min-height:42px; border:0; border-radius:6px; padding:0 13px; background:var(--color-border); color:var(--color-white); cursor:pointer; text-decoration:none; font:inherit; font-size:14px; line-height:1; } .button { display:inline-flex; align-items:center; justify-content:center; height:42px; min-height:42px; border:0; border-radius:6px; padding:0 13px; background:var(--color-border); color:var(--color-white); cursor:pointer; text-decoration:none; font:inherit; font-size:14px; line-height:1; }
.button:hover { background:var(--color-control-hover); } .button:hover { background:var(--color-control-hover); }
.empty { color:var(--color-text-muted); padding:15px 0; } .empty { color:var(--color-text-muted); padding:15px 0; }
.footer { margin-top:24px; color:var(--color-footer); font-size:13px; text-align:center; }
.footer-links { display:flex; justify-content:center; align-items:center; gap:16px; margin-top:8px; }
.footer-links a { color:var(--color-footer); text-decoration:none; }
.footer-links a:hover { color:var(--color-text); text-decoration:underline; }
.git-icon { display:inline-block; margin-right:4px; font-size:16px; line-height:1; }
.meta-dialog { position:fixed; inset:0; background:var(--color-overlay); display:none; align-items:center; justify-content:center; z-index:900; padding:20px; } .meta-dialog { position:fixed; inset:0; background:var(--color-overlay); display:none; align-items:center; justify-content:center; z-index:900; padding:20px; }
.meta-dialog.active { display:flex; } .meta-dialog.active { display:flex; }
.meta-card { width:min(560px,100%); background:var(--color-surface-modal); border:1px solid var(--color-control-hover); border-radius:10px; padding:22px; box-shadow:0 10px 40px var(--color-shadow); } .meta-card { width:min(560px,100%); background:var(--color-surface-modal); border:1px solid var(--color-control-hover); border-radius:10px; padding:22px; box-shadow:0 10px 40px var(--color-shadow); }
@@ -1804,6 +1833,21 @@ async function deleteFile(kind, filename) {
} }
} }
</script> </script>
<div class="footer">
{% if git_repo_url or user_url %}
<div class="footer-links">
{% if git_repo_url %}
<a href="{{ git_repo_url }}" target="_blank" rel="noopener noreferrer">
<span class="git-icon" aria-hidden="true">⎇</span> App auf Git
</a>
{% endif %}
{% if user_url %}
<a href="{{ user_url }}">Benutzerseite</a>
{% endif %}
</div>
{% endif %}
</div>
</body> </body>
</html> </html>
""" """