Commit Graph

42 Commits

Author SHA1 Message Date
irrlicht cb3da3bb24 Soft-Delete: Beiträge als [deleted] erhalten statt löschen
- entry.deleted; entrySelect LEFT JOIN + COALESCE(username)
- POST /entry/{pid}/delete: deleted=1, Inhalt/Bild/Autor geleert, Zeile bleibt
- Konto-Löschung soft-deletet die eigenen Beiträge (statt hartem DELETE),
  damit fremde Antworten nicht verwaisen
- Frontend: [deleted]-Platzhalter im Feed, Löschen-Button auf Focus-Seite
- notes/migrations.md: ALTER TABLE deleted

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 13:21:42 +02:00
irrlicht ba085eff4e Threading: Antworten (reply_to) + Focus-View
- entry: reply_to/reply_count/last_activity; reply_count bubbelt bis Root
- Hauptfeed nur Roots nach last_activity, Profil-Feed inkl. Antworten
- GET /entry/{pid}/thread (Ahnen+Antworten), GET /e/{pid} Focus-Seite
- Frontend: Antworten-Link im Feed, entry.html/entry.js Focus-Seite
- notes/migrations.md: ALTER TABLE fuer Prod

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:21:55 +02:00
irrlicht 844bbb44e7 Frontend+API: Namen ändern (POST /user/rename)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 11:47:44 +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 2ab08ebf9a Alten Flask/Python-Code und Jinja-Templates entfernt
Go-Reimplementierung hat Feature-Paritaet (inkl. URL-Linkify im
JS-Frontend via linkify()). static/ bleibt (Go liefert /static/* aus
und legt Uploads unter static/media/ ab); alte Flask-Assets dort
unberuehrt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:37:47 +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 bee1305a2b Add endpoint tests with httptest
Two small refactors make the handlers testable:
- extract route registration into routes() http.Handler (was inline in main)
- initDB(dsn) takes a DSN so tests use an isolated temp-file DB

loginJitter var lets tests disable the anti-timing sleep for speed.

endpoints_test.go covers the main flows via httptest + cookie jar:
register/login/headerbar, empty-then-populated feed, create requires auth,
voting (new/toggle/switch, per-user tallies), vote auth + invalid mode,
and account deletion (wrong/correct password, login fails after).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:16:02 +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 c904e3e2db Implement user account deletion flow
POST /user/delete (auth required) verifies the password via pass1 and
transactionally removes the user's sessions, votes, entries and the user
row, then clears the session cookie. Associated media files are removed
best effort after commit. This was only a stub in the Flask original.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 10:19:29 +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
irrlicht c2a8199a84 Moved user creation to user_controller.new() 2025-12-23 01:15:15 +01:00
irrlicht 6f6d05fe31 Added Semicolon to URL-Regex, so Youtube-Links with List-Index are properly shown 2025-12-22 23:53:35 +01:00
irrlicht 3d9eae89de Removed old stuff 2025-12-22 23:33:39 +01:00
irrlicht 782e608db4 Revert "Removed old stuff"
This reverts commit 45e66ca7e6.
2025-12-20 05:27:10 +01:00
irrlicht 45e66ca7e6 Removed old stuff 2025-12-20 03:50:00 +01:00
irrlicht a3afb0726f ? 2025-12-20 03:46:45 +01:00
irrlicht 8c2429732e Margin of .content 2025-12-20 03:46:25 +01:00
irrlicht a180fa6a74 Added fetchone Option to database.fetch 2025-12-20 03:45:42 +01:00
irrlicht 37c3c8dac8 Added content filter for max len and URLs 2025-12-17 22:14:30 +01:00
irrlicht 01e6e92c78 Impressum 2025-12-17 04:34:31 +01:00
irrlicht 08008b5c70 Beitragsordnung 2025-12-17 04:26:55 +01:00
irrlicht 9815ddac83 Remove ID from posts 2025-12-17 03:26:34 +01:00
irrlicht cbcbcf5dda Added Content Notice 2025-12-17 02:57:17 +01:00
irrlicht 7eb4c82a4a Background design, fonts loaded locally, normalize CSS CDN 2025-12-16 02:32:25 +01:00
irrlicht 64776ea8d0 Not sure what I've done. I'm done. Please let me free 2025-12-16 01:45:51 +01:00
irrlicht cfebe0a535 Redesigned headerbar 2025-12-15 17:07:42 +01:00
irrlicht 35ba9e08ed Removed debug page no output 2025-12-15 16:16:36 +01:00
irrlicht 4c8f66db98 Added infinite scroll 2025-12-15 16:12:46 +01:00
irrlicht 1453a52097 Removed debug-sleep of 3 seconds lol 2025-12-15 15:44:20 +01:00
irrlicht 3b75ea33b9 Global loading indicator 2025-12-15 15:42:03 +01:00
irrlicht fef5119a03 Login redirect only on success and new auth success message 2025-12-15 15:29:16 +01:00
irrlicht 36dbc849ca Global Loading screen and page title of Index 2025-12-15 15:15:37 +01:00
irrlicht 3c3e972a09 Fix: Create User form didn't reload 2025-12-15 14:47:56 +01:00
irrlicht 28340bf0b8 Form Styling updated 2025-12-15 14:41:23 +01:00
irrlicht dc3ce5ca88 Refactored, redesigned Authmethods 2025-12-15 14:28:12 +01:00
irrlicht 2dcc389f4b Datenverlust-Counter hinzugefügt 2025-12-13 12:54:43 +01:00
irrlicht 59dd267659 initial 1312 funktioniert ein bisschen 2025-12-13 12:21:44 +01:00