fixes #769
- fixed response.include_files() to behave correctly with response.static_version_urls - added response.static_version_urls to admin - refactored admin URL() usage passing always and correctly 'static' as the controller
This commit is contained in:
@@ -47,3 +47,4 @@ if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage']
|
||||
#set static_version
|
||||
from gluon.settings import global_settings
|
||||
response.static_version = global_settings.web2py_version.split('-')[0]
|
||||
response.static_version_urls = True
|
||||
|
||||
@@ -9,7 +9,7 @@ var current_editor = "{{=editor_settings['editor']}}"; //Default editor
|
||||
{{pass}}
|
||||
var current_font_incr = 0; // Default font-size, 0 means don't set
|
||||
</script>
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
{{cm=URL('static', 'codemirror')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
|
||||
@@ -44,9 +44,9 @@ def file_create_form(location, anchor=None, helptext=""):
|
||||
url = URL('edit', args=args, vars=vars)
|
||||
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
|
||||
}}
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
{{js_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'js')}}
|
||||
{{css_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'css')}}
|
||||
{{cm=URL('static', 'codemirror')}}
|
||||
{{js_url=URL('static', 'js')}}
|
||||
{{css_url=URL('static', 'css')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
@@ -311,8 +311,8 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
<!-- Typeahead scripts here so the page load faster -->
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/typeahead.min.js')}}"></script>
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/hogan-2.0.0.js')}}"></script>
|
||||
<script src="{{=URL('static', 'js/typeahead.min.js')}}"></script>
|
||||
<script src="{{=URL('static', 'js/hogan-2.0.0.js')}}"></script>
|
||||
<script>
|
||||
$('.typeahead-tw').typeahead({
|
||||
name: 'files',
|
||||
|
||||
Reference in New Issue
Block a user