From d79ad8c1f0f5a8eb6648ed76ee4a4ec5985bff44 Mon Sep 17 00:00:00 2001 From: geese_suck Date: Tue, 29 Nov 2022 14:01:25 -0800 Subject: [PATCH] event asset caching --- files/helpers/assetcache.py | 5 +++++ files/templates/util/html_head.html | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/files/helpers/assetcache.py b/files/helpers/assetcache.py index 8fdb24f90..8a39c7166 100644 --- a/files/helpers/assetcache.py +++ b/files/helpers/assetcache.py @@ -5,11 +5,16 @@ from collections import defaultdict import gevent import gevent_inotifyx as inotify +from files.helpers.const import HOLIDAY_EVENT + ASSET_DIR = 'files/assets' ASSET_SUBDIRS = ['/css', '/js', '/js/vendor'] ASSET_URL = '/assets/' ASSET_CACHE = defaultdict(lambda: None) +if HOLIDAY_EVENT: + ASSET_SUBDIRS.extend(['/css/event', '/js/event']) + def assetcache_build(asset_dir, subdirs): for subdir in subdirs: for root, dirs, files in os.walk(asset_dir + subdir): diff --git a/files/templates/util/html_head.html b/files/templates/util/html_head.html index 3940a6261..820732e5f 100644 --- a/files/templates/util/html_head.html +++ b/files/templates/util/html_head.html @@ -116,7 +116,7 @@ } {% endif %} - {% if include_user_css %} + {% if include_user_css and not EVENT_STYLES %} {% if v.css and not request.path.startswith('/settings/css') %}