Initial commit
This commit is contained in:
commit
5cda7bc309
28 changed files with 1173 additions and 0 deletions
17
yksa_kit/context_processors.py
Normal file
17
yksa_kit/context_processors.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
|
||||
#: Quick-pick zones for the navbar switcher; override with YKSA_COMMON_TIMEZONES.
|
||||
DEFAULT_COMMON_TIMEZONES = ["UTC", "Europe/Moscow", "Asia/Yakutsk", "Asia/Tokyo"]
|
||||
|
||||
|
||||
def ui_preferences(request):
|
||||
return {
|
||||
"current_timezone_name": timezone.get_current_timezone_name(),
|
||||
"common_timezones": getattr(
|
||||
settings, "YKSA_COMMON_TIMEZONES", DEFAULT_COMMON_TIMEZONES
|
||||
),
|
||||
"cookie_consent": request.COOKIES.get("yksa_cookie_consent", ""),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue