diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index 078c3d4d..743dbead 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -87,6 +87,7 @@ TEMPLATES = [ 'header_fotky.context_processors.vzhled', 'various.context_processors.rozliseni', 'various.context_processors.april', + 'various.context_processors.halloween', ) }, }, diff --git a/mamweb/static/css/base.css b/mamweb/static/css/base.css index b129e63e..a7febafc 100644 --- a/mamweb/static/css/base.css +++ b/mamweb/static/css/base.css @@ -8,6 +8,13 @@ font-weight: normal; } +@font-face { + font-family: 'GhoulFace'; + src: url("../fonts/ghoul/ghoulheadline.ttf"), + url("../fonts/ghoul/ghoul.woff"); + font-weight: normal; +} + body { font-size: 14px; font-family: 'OpenSans'; diff --git a/mamweb/static/fonts/ghoul/ghoul.ttf b/mamweb/static/fonts/ghoul/ghoul.ttf new file mode 100644 index 00000000..64bab478 Binary files /dev/null and b/mamweb/static/fonts/ghoul/ghoul.ttf differ diff --git a/mamweb/static/fonts/ghoul/ghoulheadline.ttf b/mamweb/static/fonts/ghoul/ghoulheadline.ttf new file mode 100644 index 00000000..90d4f7c1 Binary files /dev/null and b/mamweb/static/fonts/ghoul/ghoulheadline.ttf differ diff --git a/mamweb/templates/april.html b/mamweb/templates/april.html index bb24d9d4..da684ed3 100644 --- a/mamweb/templates/april.html +++ b/mamweb/templates/april.html @@ -78,3 +78,16 @@ walkText(document.body); {% endif %} + + + +{% if halloween == 2024 %} + +{% endif %} diff --git a/various/context_processors.py b/various/context_processors.py index a1e4478a..331780b1 100644 --- a/various/context_processors.py +++ b/various/context_processors.py @@ -15,6 +15,19 @@ def april(req): return {'april': today.year} return {} +def halloween(req): + if 'X-Halloween' in req.headers: + try: + year = int(req.headers['X-Halloween']) + return {'halloween': year} + except: + pass # Fall-back to regular behaviour + + import datetime + today = datetime.date.today() + if today.month == 10 and today.day >= 25: + return {'halloween': today.year} + return {} def rozliseni(request): ltp = settings.LOCAL_TEST_PROD