event asset caching
parent
5056f09380
commit
d79ad8c1f0
|
@ -5,11 +5,16 @@ from collections import defaultdict
|
||||||
import gevent
|
import gevent
|
||||||
import gevent_inotifyx as inotify
|
import gevent_inotifyx as inotify
|
||||||
|
|
||||||
|
from files.helpers.const import HOLIDAY_EVENT
|
||||||
|
|
||||||
ASSET_DIR = 'files/assets'
|
ASSET_DIR = 'files/assets'
|
||||||
ASSET_SUBDIRS = ['/css', '/js', '/js/vendor']
|
ASSET_SUBDIRS = ['/css', '/js', '/js/vendor']
|
||||||
ASSET_URL = '/assets/'
|
ASSET_URL = '/assets/'
|
||||||
ASSET_CACHE = defaultdict(lambda: None)
|
ASSET_CACHE = defaultdict(lambda: None)
|
||||||
|
|
||||||
|
if HOLIDAY_EVENT:
|
||||||
|
ASSET_SUBDIRS.extend(['/css/event', '/js/event'])
|
||||||
|
|
||||||
def assetcache_build(asset_dir, subdirs):
|
def assetcache_build(asset_dir, subdirs):
|
||||||
for subdir in subdirs:
|
for subdir in subdirs:
|
||||||
for root, dirs, files in os.walk(asset_dir + subdir):
|
for root, dirs, files in os.walk(asset_dir + subdir):
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if include_user_css %}
|
{% if include_user_css and not EVENT_STYLES %}
|
||||||
<link rel="stylesheet" href="{{('css/'~v.theme~'.css') | asset}}">
|
<link rel="stylesheet" href="{{('css/'~v.theme~'.css') | asset}}">
|
||||||
{% if v.css and not request.path.startswith('/settings/css') %}
|
{% if v.css and not request.path.startswith('/settings/css') %}
|
||||||
<style>
|
<style>
|
||||||
|
@ -147,7 +147,8 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if EVENT_STYLES %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.path == '/chat' %}
|
{% if request.path == '/chat' %}
|
||||||
|
|
Loading…
Reference in New Issue