Add explicit checks for existence of JS. Fixes #165

pull/211/head
James Ramm 2018-12-28 15:52:37 +01:00
rodzic b744861492
commit 356833b484
1 zmienionych plików z 14 dodań i 2 usunięć

Wyświetl plik

@ -1,16 +1,28 @@
import os
from django import template
from longclaw import settings
register = template.Library()
CLIENT_PATH = os.path.join('core', 'js', 'longclawclient.bundle.js')
VENDORS_PATH = os.path.join('core', 'js', 'vendors.bundle.js')
@register.inclusion_tag("core/script.html")
def longclaw_vendors_bundle():
return {'path': 'core/js/vendors.bundle.js'}
assert os.path.exists(
os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', VENDORS_PATH)
)
return {'path': VENDORS_PATH}
@register.inclusion_tag("core/script.html")
def longclaw_client_bundle():
return {'path': 'core/js/longclawclient.bundle.js'}
assert os.path.exists(
os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', CLIENT_PATH)
)
return {'path': CLIENT_PATH}
@register.simple_tag
def longclaw_api_url_prefix():
return settings.API_URL_PREFIX