Commit Graph

11 Commits

Author SHA1 Message Date
irrlicht d9028a8400 Header: Statuszeile "Ohne Datenverlust seit n Tagen" + Kennzahlen zurückholen
Schlanke Wiederbelebung des alten Uptime-Schriftzugs aus der Python-Version,
jetzt als kleine Zeile direkt unter dem Titel: Tage seit fixem Startpunkt
(13.12.2025, Kontinuität) plus aktuelle Profil- und Beitragszahlen.

- /stats: neuer öffentlicher Endpunkt (COUNT user / COUNT entry WHERE deleted=0)
- app.js: renderStats() rechnet die Tage und füllt #stats per textContent
- index.html: <p id="stats" class="tagline"> unter der h1
- app.css: kleine graue .tagline-Zeile

Kein Inline-JS/CSS -> strikte CSP bleibt unangetastet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 08:46:05 +02:00
irrlicht 720d5d64d5 Header: Doku-Links, Profil-Button & Titel "Kontrollverlust"
Impressum/Datenschutz/Beitragsordnung als Links ueber der Ueberschrift,
Ueberschrift in "Kontrollverlust" umbenannt (verlinkt auf den Feed),
"mein Profil" und "zurueck zum Feed" im Button-Layout. datenschutz.html
aus bb6b966 wiederhergestellt, damit der Link nicht ins Leere fuehrt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 10:23:41 +02:00
irrlicht 7ffc35808a User 2026-06-02 16:35:47 +02:00
irrlicht 2dcba21250 Frontend: roher Oldschool-Look, CSS auf 6 Zeilen
- Dark-Theme, Farbvariablen, Border-Radius, custom Form-Controls und
  Layout-Zentrierung entfernt -> natives Browser-Default-Rendering
- nur noch: 1px-Rahmen um Beitraege (eckig), graue Nebentexte, rote
  Fehler, fett fuer gewaehlte Stimme
- Textarea-Hoehe via rows-Attribut, <details> nativ (Danger-Klasse weg)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 10:47:02 +02:00
irrlicht f442138043 Frontend: CSS auf allgemeine Klassen verschlankt (82 Zeilen)
- ID-Selektoren (#account-info, #delete-form button) und verschachtelte
  Selektoren (.entry .meta, .interactions .vote) entfernt
- wiederverwendbare Klassen: .card, .muted, .row, .ghost
- globale a/h1/h2-Regeln, Farben als CSS-Variablen (--border, --danger)
- HTML/JS synchron umgestellt; counts-Span via querySelector("span")
- Cross-Check: keine toten CSS-Klassen, keine unbekannten Referenzen

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 10:29:40 +02:00
irrlicht d1a269db2f Frontend: Account-Bereich (GET /user/info, POST /user/delete)
- Account-Section nur sichtbar wenn eingeloggt; zeigt Nutzername und
  Mitglied-seit-Datum aus /user/info
- Konto loeschen in aufklappbarer Danger-Zone, Passwortbestaetigung
  plus zusaetzliche confirm()-Rueckfrage (unwiderruflich)
- nach Loeschung zurueck zur Login-Ansicht via refreshHeader

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:59:53 +02:00
irrlicht a47f41bbfa Frontend: Registrierung angebunden (POST /auth/newuser)
- Umschalter Login <-> Registrieren im Auth-Bereich
- Fehlerlisten-Anzeige ({"errors": [...]}) fuer newuser
- nach erfolgreicher Registrierung automatischer Login
- Logout setzt Ansicht auf Login zurueck

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:47:00 +02:00
irrlicht e210df3e2e Code-Cleanup: toter Check, none-Sentinel, Login-Jitter raus
- entry.go: redundantes stored != "" entfernt
- filepath-Sentinel "none" -> leerer String (Go-Zero-Value),
  Checks in entry.go/user.go und web/js/app.js vereinfacht
- auth.go: zufaelligen Login-Jitter samt loginJitter-Variable und
  Test-Seam entfernt (war nur Spielerei, kein echter Schutz)
- notes/migrations.md: einmalige "none"->"" Migration dokumentiert

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:33:41 +02:00
irrlicht 38da498754 Split voting into clean read/write endpoints
Replaces the GET-mutates-state interactions route with a proper split:
- GET  /entry/{pid}/votes  reads the tally (public, read-only)
- POST /entry/{pid}/vote   casts/toggles the vote (auth, mode in body)

Shared voteTally/writeTally helpers back both handlers. Invalid mode now
returns 400. Frontend updated to read via GET and vote via POST.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:03:33 +02:00
irrlicht be8dbb4902 Implement left/right voting on entries
GET /entry/{pid}/interactions/{mode} now reads the vote tally and, for
mode=left/right (auth required), toggles the user's vote: new vote, repeat
same mode removes it, different mode switches. Returns {left, right,
selected}. A UNIQUE(uid, pid) constraint on the vote table prevents
duplicate votes. The JS frontend renders Links/Rechts buttons with live
counts under each entry.

This completes the voting feature that was left commented-out and broken
in the Flask version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 10:58:58 +02:00
irrlicht cb237c248e Rewrite backend in Go with JSON API and JS frontend
Reimplements the Flask app as a Go HTTP API (chi + modernc sqlite) with a
minimal vanilla-JS frontend in web/. Endpoints mirror the original Flask
routes but return JSON instead of HTML.

- auth: login/logout/register/sessioninfo/headerbar with crypto/rand tokens
- entry: paginated feed (single JOIN), create with image scaling
- user: profile, userinfo; delete still a stub
- requireAuth middleware passes uid via context
- notes/api.md documents the API and schema

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 10:17:02 +02:00