Add cron container and per-household timezone for auto-reminders
CI / test-and-package (push) Successful in 36s

- docker-compose.yml: meal-cron service loops send_reminders_cron.py every 60s
- send_reminders_cron.py: checks each household's local time, sends ntfy
  reminders at 10:00 (lunch) and 16:00 (dinner), guarded against duplicates
- models.py: timezone, last_lunch_reminder, last_dinner_reminder on households
- meals.py: /admin/timezone route for admins to set household timezone
- dashboard: timezone selector (20 common zones) in Account Settings
- i18n: 5 new translation keys for timezone strings
- Dockerfile: copy send_reminders_cron.py
- tests: 4 new timezone tests (admin set, non-admin denied, default UTC, auth)
- docs: updated AGENTS.md
This commit is contained in:
agentbox
2026-08-01 06:23:33 +00:00
parent 3681f9dfce
commit 2cd435daf2
9 changed files with 248 additions and 2 deletions
+18
View File
@@ -113,6 +113,24 @@
</div>
</form>
{% if is_admin %}
<form method="POST" action="{{ url_for('meals.admin_set_timezone') }}" class="manage-form">
<h4>🕐 {{ t('Household Timezone') }}</h4>
<p class="hint">{{ t('Used to send reminders at 10:00 (lunch) and 16:00 (dinner) local time.') }}</p>
<select name="timezone" class="select-input">
{% set tz = household.timezone or 'UTC' %}
{% for zone in ['UTC', 'Europe/Zurich', 'Europe/Paris', 'Europe/Berlin', 'Europe/London',
'America/New_York', 'America/Chicago', 'America/Denver', 'America/Los_Angeles',
'America/Toronto', 'America/Sao_Paulo', 'America/Argentina/Buenos_Aires',
'Asia/Tokyo', 'Asia/Shanghai', 'Asia/Kolkata', 'Asia/Dubai',
'Australia/Sydney', 'Pacific/Auckland', 'Africa/Cairo', 'Africa/Johannesburg'] %}
<option value="{{ zone }}" {% if zone == tz %}selected{% endif %}>{{ zone }}</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-primary btn-sm" style="margin-top: 8px;">{{ t('Save') }}</button>
</form>
{% endif %}
{% if is_admin %}
<form method="POST" action="{{ url_for('meals.admin_delete_household') }}"
onsubmit="return confirm(this.dataset.confirmMsg);"