From eda106849e7ef5584b3a0a546e47547b5cacd737 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 15 Jul 2026 22:47:20 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20einheitliche=20rote=20Herzen=20=C3=BCber?= =?UTF-8?q?all=20=E2=80=94=20kein=20Blau,=20keine=20Invertierung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .detail-like-btn: SVG fill=#EF4444, liked kein background - .comment-like-btn: SVG fill=#EF4444, border entfernt, liked kein background - Alle drei Button-Typen (.stat-like, .detail-like, .comment-like) jetzt identisch: Default: rote gefüllte Herzen ohne Border Liked: nur rote Herzen, kein Hintergrundwechsel - media_path-Check: os.path.exists(path) → (MEDIA_DIR / basename).exists() --- app.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/app.py b/app.py index 4df0442..ff859d8 100644 --- a/app.py +++ b/app.py @@ -1809,8 +1809,9 @@ def submission_detail(sub_id: int): } for i, path in enumerate(paths): checked = "checked" if flags[i] == "1" else "" - if not os.path.exists(path): - media_html += f'

📁 Datei nicht gefunden: {os.path.basename(path)}

' + basename = os.path.basename(path) + if not (MEDIA_DIR / basename).exists(): + media_html += f'

📁 Datei nicht gefunden: {basename}

' continue _, ext = os.path.splitext(path) mime = mime_map.get(ext.lower(), "application/octet-stream") @@ -2725,9 +2726,9 @@ def public_frontend(): # Skip media not marked for publishing if flags[i] != "1": continue - if not os.path.exists(path): - continue basename = os.path.basename(path) + if not (MEDIA_DIR / basename).exists(): + continue _, ext = os.path.splitext(path) mime = mime_map.get(ext.lower(), "application/octet-stream") try: @@ -2956,8 +2957,8 @@ def public_frontend(): .stat-like-btn { background:none; border:none; border-radius:999px; padding:0.25rem 0.6rem; font-size:0.72rem; cursor:pointer; color:#9CA3AF; font-family:inherit; transition:all 0.15s; display:flex; align-items:center; gap:0.2rem; -webkit-tap-highlight-color:transparent; min-width:44px; min-height:36px; justify-content:center; } .stat-like-btn svg, .stat-like-btn svg path { stroke:#EF4444 !important; fill:#EF4444 !important; } .stat-like-btn:hover { border-color:#9CA3AF; color:#6B7280; } - .stat-like-btn.liked { background:#EF4444; color:#fff; border-color:#EF4444; } - .stat-like-btn.liked svg, .stat-like-btn.liked svg path { stroke:#fff !important; fill:#fff !important; } + .stat-like-btn.liked { background:none; } + .stat-like-btn.liked svg, .stat-like-btn.liked svg path { stroke:#EF4444 !important; fill:#EF4444 !important; } .stat-like-btn:active { transform:scale(0.96); } /* Filter bar */ @@ -4515,7 +4516,8 @@ def public_detail(sub_id: int): for i, path in enumerate(paths): if flags[i] != "1": continue - if not os.path.exists(path): + basename = os.path.basename(path) + if not (MEDIA_DIR / basename).exists(): continue _, ext = os.path.splitext(path) mime = mime_map.get(ext.lower(), "application/octet-stream") @@ -4585,7 +4587,7 @@ def public_detail(sub_id: int):
{c_author} {c_date}

{c["content"]}

- +
""" @@ -4657,10 +4659,10 @@ def public_detail(sub_id: int): .reply-btn {{ background:none; border:1px solid #ccc; border-radius:6px; padding:0.2rem 0.6rem; font-size:0.72rem; color:#666; cursor:pointer; margin-top:0.3rem; font-family:inherit; transition:all 0.15s; }} .reply-btn:hover {{ border-color:#20228a; color:#20228a; background:rgba(32,34,138,0.04); }} .comment-actions {{ display:flex; align-items:center; gap:0.4rem; margin-top:0.4rem; }} - .comment-like-btn {{ background:none; border:1.5px solid #e0dcd3; border-radius:999px; padding:0.15rem 0.5rem; font-size:0.68rem; cursor:pointer; color:#888; font-family:inherit; transition:all 0.15s; display:inline-flex; align-items:center; -webkit-tap-highlight-color:transparent; }} - .comment-like-btn:hover {{ border-color:#20228a; color:#20228a; background:rgba(32,34,138,0.05); }} - .comment-like-btn.liked {{ background:#20228a; color:#fff; border-color:#20228a; font-weight:600; }} - .comment-like-btn.liked svg, .comment-like-btn.liked svg path {{ stroke:#fff !important; }} + .comment-like-btn {{ background:none; border:none; border-radius:999px; padding:0.15rem 0.5rem; font-size:0.68rem; cursor:pointer; color:#888; font-family:inherit; transition:all 0.15s; display:inline-flex; align-items:center; -webkit-tap-highlight-color:transparent; }} + .comment-like-btn:hover {{ opacity:0.8; }} + .comment-like-btn.liked {{ background:none; }} + .comment-like-btn.liked svg, .comment-like-btn.liked svg path {{ stroke:#EF4444 !important; fill:#EF4444 !important; }} .comment-like-btn:active {{ transform:scale(0.94); }} .reply-info {{ font-size:0.75rem; color:#20228a; margin-bottom:0.3rem; font-weight:600; display:none; }} .comment-email, .comment-phone {{ padding:0.6rem 0.9rem; border:1.5px solid #ddd; border-radius:10px; font-size:0.85rem; font-family:inherit; }} @@ -4676,9 +4678,9 @@ def public_detail(sub_id: int): .site-header {{ padding:0.8rem 1rem; }} }} - .detail-like-btn:hover {{ border-color:#20228a; color:#20228a; background:rgba(32,34,138,0.05); }} - .detail-like-btn.liked {{ background:#20228a; color:#fff; border-color:#20228a; font-weight:600; }} - .detail-like-btn.liked svg, .detail-like-btn.liked svg path {{ stroke:#fff !important; }} + .detail-like-btn:hover {{ opacity:0.8; }} + .detail-like-btn.liked {{ background:none; }} + .detail-like-btn.liked svg, .detail-like-btn.liked svg path {{ stroke:#EF4444 !important; fill:#EF4444 !important; }} .detail-like-btn:active {{ transform:scale(0.94); }} @@ -4702,7 +4704,7 @@ def public_detail(sub_id: int): {"".join([f'
{content}
' if content else ''])}
{row['views'] or 0} Aufrufe - +