relative path

master
inpos 2018-08-17 21:06:07 +03:00
parent 366d6c2ec7
commit fff5f5cf85
2 changed files with 5 additions and 3 deletions

4
orun/extjs/app.html vendored
View File

@ -2,8 +2,8 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{title}</title>
<script src="/ext_620/ext-all.js"></script>
<link rel="stylesheet" href="/ext_620/{theme_model}/theme-{theme}/resources/theme-{theme}-all.css">
<script src="{base_url}/ext_620/ext-all.js"></script>
<link rel="stylesheet" href="{base_url}/ext_620/{theme_model}/theme-{theme}/resources/theme-{theme}-all.css">
<script>
Ext.onReady(function () {{
{script}

View File

@ -7,6 +7,8 @@ import cherrypy
THEME_MODEL = 'classic'
THEME = 'gray'
BASE_URL = ''
@cherrypy.expose
class ExtJS:
_cp_config = {
@ -23,7 +25,7 @@ class ExtApplication(cp.Application):
def index(self, *args, **kwargs):
f = open(os.path.join(os.path.dirname(__file__), 'app.html')).read()
self.main()
return f.format(title=self.title, theme=THEME, theme_model=THEME_MODEL, script=str(js.js_manager))
return f.format(title=self.title, base_url=BASE_URL, theme=THEME, theme_model=THEME_MODEL, script=str(js.js_manager))
@cherrypy.expose
def ajax_callback(self, *args, **kwargs):