Skip to content
Snippets Groups Projects
Commit a3af450d authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Finalize the debug controller and remove the debug view.

parent 2b0e11e8
Branches
Tags
No related merge requests found
...@@ -108,34 +108,28 @@ def debug(): ...@@ -108,34 +108,28 @@ def debug():
""" """
# check the presence of the ExtJS and MathJax plugins # check the presence of the ExtJS and MathJax plugins
dbui = local_import('plugin_dbui') dbui = local_import('plugin_dbui')
pextjs = dbui.get_plugin_path('plugin_extjs') plugin = plugins.dbui
pmathjax = dbui.get_plugin_path('plugin_mathjax')
# plugin and application css files
# internationalization (fr, fr-fr, fr-ca, ...) response.files.extend(dbui.get_file_paths(plugin.base_css, ext='.css'))
lg = dbui.get_language() response.files.extend(dbui.get_file_paths(plugin.app_css, ext='.css'))
# dbui javascript source code -- respect the alphabetic order # plugin and application javascript source code
response.files.extend(dbui.get_files('static/plugin_dbui/src', response.files.extend(dbui.get_file_paths(plugin.base_js_dir, ext='.js'))
ext='.js', response.files.extend(dbui.get_file_paths(plugin.app_js_dir, ext='.js'))
alpha=True))
# main script which can be defined in many different ways
# user javascript source code -- respect the alphabetic order pscript = dbui.get_script_path(plugin)
response.files.extend(dbui.get_files(plugins.dbui.user_src_path,
ext='.js',
alpha=True))
# main script
# keep in mind that the script can be selected from the url
# using the argument script=foo
pscript = dbui.get_script_path(plugins.dbui.script_path)
response.files.append(pscript) response.files.append(pscript)
# switch ON the debug mode on the server side # switch ON the debug mode on the server side
session.debug = True session.debug = True
# select the view
response.view = 'plugin_dbui/index.html'
# return the ExtJS path, the language # return the plugin configuration parameter as well as the response
# and a list of files in response.files return dict(plugin=plugin)
return dict(pextjs=pextjs, pmathjax=pmathjax, lg=lg)
...@@ -212,28 +206,28 @@ def index(): ...@@ -212,28 +206,28 @@ def index():
is launched. is launched.
""" """
# check the presence of the ExtJS and MathJax plugins
dbui = local_import('plugin_dbui') dbui = local_import('plugin_dbui')
pextjs = dbui.get_plugin_path('plugin_extjs') plugin = plugins.dbui
pmathjax = dbui.get_plugin_path('plugin_mathjax')
# internationalization (fr, fr-fr, fr-ca, ...) # plugin and application css files
lg = dbui.get_language() response.files.extend(dbui.get_file_paths(plugin.base_css, ext='.css'))
response.files.extend(dbui.get_file_paths(plugin.app_css, ext='.css'))
# compressed version of the user library # compressed version of the plugin javascript libraries
response.files.extend(dbui.get_files(plugins.dbui.user_libmin)) response.files.extend(dbui.get_file_paths(plugin.base_libmin, ext='.js'))
# compressed version of the application javascript library
response.files.extend(dbui.get_file_paths(plugin.app_libmin, ext='.js'))
# main script # main script which can be defined in many different ways
# keep in mind that the script can be selected from the url pscript = dbui.get_script_path(plugin)
# using the argument script=foo
pscript = dbui.get_script_path(plugins.dbui.script_path)
response.files.append(pscript) response.files.append(pscript)
# switch off the debug mode on the server side # switch off the debug mode on the server side
session.debug = False session.debug = False
# return the ExtJS, MathJax paths and the language # return the plugin configuration parameter as well as the response
return dict(pextjs=pextjs, pmathjax=pmathjax, lg=lg) return dict(plugin=plugin)
def status(): def status():
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<!-- extjs + dbui + application css --> <!-- extjs + dbui + application css -->
<link rel="stylesheet" type="text/css" href="{{=plugin.base_pextjs}}/resources/css/ext-all.css"/> <link rel="stylesheet" type="text/css" href="{{=plugin.base_pextjs}}/resources/css/ext-all.css"/>
{{for el in response.files:}}{{if el.endswith('.css'):}}<link rel="stylesheet" type="text/css" href="{{=el}}"/>{{pass}} {{for el in response.files:}}{{if el.endswith('.css'):}}<link rel="stylesheet" type="text/css" href="{{=el}}"/>{{else: continue}}{{pass}}
{{pass}} {{pass}}
<!-- extjs javascript library --> <!-- extjs javascript library -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment