master
inpos 2018-08-23 22:44:20 +03:00
parent f465f2e426
commit 3af334c7dd
1 changed files with 5 additions and 8 deletions

View File

@ -7,17 +7,9 @@ import cherrypy
THEME_MODEL = 'classic' THEME_MODEL = 'classic'
THEME = 'gray' THEME = 'gray'
CHART_THEME_MODEL = 'classic/classic' if THEME_MODEL == 'classic' else 'modern/modern-' + THEME CHART_THEME_MODEL = 'classic/classic' if THEME_MODEL == 'classic' else 'modern/modern-' + THEME
BASE_URL = '' BASE_URL = ''
ENABLE_CHARTS=False ENABLE_CHARTS=False
CHART_HTML_CODE = '''<script type="text/javascript" src="{base_url}/ext_620/packages/charts/{theme_model}/charts.js"></script>
<link rel="stylesheet" type="text/css" href="{base_url}/ext_620/packages/charts/{chart_theme_model}/resources/charts-all.css">
'''.format(base_url=BASE_URL,
theme_model=THEME_MODEL,
chart_theme_model=CHART_THEME_MODEL)
@cherrypy.expose @cherrypy.expose
class ExtJS: class ExtJS:
_cp_config = { _cp_config = {
@ -35,6 +27,11 @@ class ExtApplication(cp.Application):
f = open(os.path.join(os.path.dirname(__file__), 'app.html')).read() f = open(os.path.join(os.path.dirname(__file__), 'app.html')).read()
self.main() self.main()
CHART_HTML_CODE = '''<script type="text/javascript" src="{base_url}/ext_620/packages/charts/{theme_model}/charts.js"></script>
<link rel="stylesheet" type="text/css" href="{base_url}/ext_620/packages/charts/{chart_theme_model}/resources/charts-all.css">
'''.format(base_url=BASE_URL,
theme_model=THEME_MODEL,
chart_theme_model=CHART_THEME_MODEL)
EXTJS_PACKAGES = '' + CHART_HTML_CODE if ENABLE_CHARTS else '' EXTJS_PACKAGES = '' + CHART_HTML_CODE if ENABLE_CHARTS else ''
return f.format(title=self.title, return f.format(title=self.title,