Releases: iplweb/django-countdown
Releases · iplweb/django-countdown
django-countdown 0.2.0
Added
- i18n: every user-visible string now flows through
gettext_lazy/
{% trans %}, with full Polish translations shipped in
django_countdown/locale/pl/LC_MESSAGES/django.{po,mo}. manage.py start_countdownmanagement command — interactive by
default (asks how long the banner shows, then how long service mode
lasts), or non-interactive via--banner +5m --service +30m --message … --noinput. Service duration acceptsindefinite/forever/infto
keep the site blocked until an admin removes the countdown.- Indefinite maintenance mode: when
maintenance_untilisNonethe
site stays blocked indefinitely. NewSiteCountdown.is_indefinite()
helper + admin column; banner and blocked templates render an
"indefinite — remove the countdown to unblock" affordance instead of a
broken counter. - CSS-framework-agnostic blocked-page themes: three variants —
blocked.html(plain, default — ships its own stylesheet, no Bootstrap
/ Foundation / Tailwind required),blocked_foundation.html,
blocked_bootstrap.html— all extending a sharedblocked_base.html
so themes inherit translations automatically. Pick one via the new
DJANGO_COUNTDOWN_BLOCKED_TEMPLATEsetting. - Example app discovery page: the example project now has a real
/page listing all template variants with one-click previews
(/preview/<plain|foundation|bootstrap>/[indefinite/]) and a
/healthz/endpoint for confirming the middleware blocks correctly. SiteCountdownmodel + admin (extracted from
iplweb/bpp @ 75f3c70f7) with
countdown_timeand optionalmaintenance_until.CountdownBlockingMiddlewarereturning HTTP 503 for non-superuser
requests once the countdown has expired and maintenance has not yet
ended.countdown_contextcontext processor exposingactive_countdown/
maintenance_countdownto templates.- Template partials:
countdown_banner.htmlandblocked.html.
Changed
countdown_banner.htmlno longer depends ondjango-compressor; it
just{% static %}-loads the package stylesheet.blocked.htmlno longer pulls Foundation Sites or foundation-icons by
default. Useblocked_foundation.htmlif you want that look.- All hard-coded Polish field labels, help-texts, and admin headings in
the model + admin migrated to English as the source language, with
Polish kept as a first-class translation.
Fixed
admin.time_remaining_displaytwoformat_html()calls with no
substitutions raisedTypeErroron Django 6.0 (strict signature).
Replaced withmark_safe()for the literal-HTML branches.
Migrations
0005_alter_sitecountdown_options_and_more.pyrecords the English
field metadata. Runningmigrateis required after upgrading.