feat: public sharing links for households
CI / test-and-package (push) Successful in 40s

Add hard-to-guess public URLs (/public/<token>) that show a read-only
meal status dashboard for each household. Only people with the link can
see the data — no login required.

- models.py: public_token + public_enabled columns on households,
  get_household_by_public_token(), generate_public_token(),
  set_public_enabled()
- meals.py: /public/<token> route, /admin/public-link for
  generate/disable/enable/regenerate
- templates/public.html: clean read-only public dashboard
- templates/public-not-found.html: 404 for invalid/disabled links
- templates/dashboard.html: admin UI with copy/regenerate/disable
- static/style.css: public page and URL box styles
- i18n.py: 18 new translation keys (en/fr/de)
This commit is contained in:
agentbox
2026-08-01 10:12:21 +00:00
parent 2a3101071b
commit ae95841b5b
7 changed files with 330 additions and 0 deletions
+30
View File
@@ -257,6 +257,36 @@ body {
.lang-active { background: var(--primary); color: #fff; }
.lang-active:hover { background: #0d47a1; color: #fff; }
/* ── Public page ── */
.public-page .navbar {
justify-content: space-between;
}
.public-heading {
margin-bottom: 16px;
}
.public-footer {
text-align: center;
color: var(--muted);
font-size: 0.8rem;
margin-top: 32px;
}
.public-url-box {
display: flex;
align-items: center;
gap: 8px;
background: #f5f5f5;
border: 1px solid var(--border);
border-radius: 4px;
padding: 6px 10px;
margin-top: 8px;
word-break: break-all;
}
.public-url-box code {
flex: 1;
font-size: 0.8rem;
color: var(--text);
}
/* ── Responsive ── */
@media (max-width: 600px) {
.navbar {