Commit graph

21 commits

Author SHA1 Message Date
b7de2cb300 Add auth.js module 2026-05-08 11:42:08 +02:00
6e54d4c499 Add ui.js module 2026-05-08 11:40:48 +02:00
fa68017d49 Add goals.js module 2026-05-08 11:39:47 +02:00
7f92cc32b7 Add api.js module 2026-05-08 11:38:43 +02:00
01a7a4cb59 Add i18n.js module 2026-05-08 11:36:44 +02:00
f2fb10b753 Add state.js module 2026-05-08 11:34:19 +02:00
99304a6174 Fix session-expiry redirect not showing login form
When Symfony returns a non-JSON body (empty or HTML) for a 401 on
protected API routes, res.json() throws a SyntaxError with no .status,
so showLogin() was never called. Now the HTTP status is preserved
through JSON parse failures so the 401 check works correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 20:03:21 +02:00
7ea6aeb98c Add API loading indicator and session-expiry auto-redirect
- Thin animated bar at page top shows while any fetch is in-flight
- api() centrally redirects to login on 401 (except login endpoint)
- Logo click triggers manual goal refresh
- cursor:pointer on logo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 12:48:01 +02:00
bd0190cfde Always floor buffer value to avoid fractional display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:12:35 +02:00
4e1028e1a1 Keep screen awake via Wake Lock API while stopwatch is running
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 09:53:41 +02:00
e9995bb5d2 Change log button label from text to '+' to save space
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:26:35 +02:00
61d07d09b9 Fix Quick-Buchen visibility: always show on negative buffer, hide when buf >= daily
Rules:
- buf < 0 (behind) → always visible to catch up
- buf >= daily (more than a day ahead) → hidden
- otherwise → visible only if today not yet reached daily goal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:26:05 +02:00
88cc05e999 Fix stopwatch fill button not updating addAmt state
Setting inp.value programmatically bypasses the oninput handler that
syncs addAmt[k], so addSet read 0. Firing the input event after fill
ensures the value is registered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:23:41 +02:00
c9e8f69c3f Invite improvements: cap pending at 10, sort by status, hide old expired
- Max 10 pending invites per user (400 if exceeded)
- List sorted: pending → used → expired
- Expired invites hidden after 30 days
- Frontend shows error toast from server message on invite creation failure
- Tests: testInviteMaxTenPending, testInviteListSortOrder, testInviteExpiredHiddenAfter30Days

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:22:16 +02:00
950c3bcfc5 Hide goal from quick-book when buffer covers a full day
If the accumulated buffer (buf) is >= the daily target, the goal is
already covered for today and doesn't need to appear in Quick-Buchen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:13:20 +02:00
eea6119e36 Add admin user list view for simon@kuehn.de
- ADMIN_EMAIL env var controls who has admin access
- GET /api/admin/users returns all users (id, email, username, registered);
  returns 403 for non-admins
- GET /api/me now includes is_admin flag
- Menu shows "Nutzer/Users/Użytkownicy" button for admins that opens a
  table with name, email, and registration date for all users

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 10:06:14 +02:00
9d4c710d2f Add DE/EN/PL i18n with browser-language detection and per-user override
- STRINGS object in app.js with all UI strings in de/en/pl
- tr() function, ldoc() locale-aware date formatting
- tpl() auto-translates data-t/data-ph/data-val attributes on clone
- app.html.twig: data-t attributes on all template static text, language picker in data menu
- locale CHAR(2) column on users table; GET /api/me returns locale; PATCH /api/me accepts locale
- setLocale() persists to API + localStorage; applyLocale() reads user.locale → localStorage → navigator.language

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 13:34:41 +02:00
8729b0d1ed Add weekly goal field to new goal form
Tagesziel and Wochenziel sync automatically (weekly = daily * 7). Only daily is stored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:08:23 +02:00
a8f6692de4 Add stopwatch fill button and asset cache-busting
- Stopwatch ⏱ button appears in add/quick-book rows when sw >= 1s, fills input with floor(seconds)
- AppController passes md5 hashes of app.js/style.css to template for automatic cache-busting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 11:00:54 +02:00
f0cbe5b5d0 Add header stopwatch and asset cache-busting
- Stopwatch between logo and menu: tap to start, tap to stop, tap to reset
- AppController passes md5-based version hash for app.js and style.css to prevent browser caching issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 10:35:29 +02:00
fd473f00af Initial commit: Dudi habit tracker
Symfony 8 SPA with Doctrine ORM, Symfony Security, vanilla JS frontend.
Migrated from plain PHP (delight-im/auth + raw SQL) to full Symfony stack.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:40:57 +02:00