kopia lustrzana https://github.com/longclawshop/longclaw
Add explicit checks for existence of JS. Fixes #165
rodzic
b744861492
commit
356833b484
|
@ -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
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue