forked from MarseyWorld/MarseyWorld
event asset caching
parent
5056f09380
commit
d79ad8c1f0
|
@ -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):
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
{% if include_user_css %}
|
||||
{% if include_user_css and not EVENT_STYLES %}
|
||||
<link rel="stylesheet" href="{{('css/'~v.theme~'.css') | asset}}">
|
||||
{% if v.css and not request.path.startswith('/settings/css') %}
|
||||
<style>
|
||||
|
@ -147,7 +147,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if EVENT_STYLES %}
|
||||
<link rel="stylesheet" href="/assets/css/event/{{EVENT_STYLES}}">
|
||||
{% set EVENT_STYLES = 'css/event/'+EVENT_STYLES %}
|
||||
<link rel="stylesheet" href="{{EVENT_STYLES | asset}}">
|
||||
{% endif %}
|
||||
|
||||
{% if request.path == '/chat' %}
|
||||
|
|
Loading…
Reference in New Issue