fixes #1407 passing a properly escaped string

This commit is contained in:
niphlod
2016-09-29 00:12:59 +02:00
parent 78cc6d69a2
commit 3a6df38d62
4 changed files with 21 additions and 15 deletions
+7 -5
View File
@@ -1,10 +1,12 @@
<script type="text/javascript"><!-- <script type="text/javascript"><!--
// These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below). // These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below).
var w2p_ajax_confirm_message = '{{=T('Are you sure you want to delete this object?')}}'; {{=ASSIGNJS(
var w2p_ajax_disable_with_message = '{{=T('Working...')}}'; w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}'; w2p_ajax_disable_with_message = T('Working...'),
var w2p_ajax_datetime_format = '{{=T('%Y-%m-%d %H:%M:%S')}}'; w2p_ajax_date_format = T('%Y-%m-%d'),
var ajax_error_500 = '{{=T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars) }}'; w2p_ajax_datetime_format = T('%Y-%m-%d %H:%M:%S'),
ajax_error_500 = T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars)
)}}
//--></script> //--></script>
{{ {{
response.files.insert(0,URL('static','js/jquery.js')) response.files.insert(0,URL('static','js/jquery.js'))
+6 -5
View File
@@ -1,10 +1,11 @@
<script type="text/javascript"><!-- <script type="text/javascript"><!--
// These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below). // These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below).
var w2p_ajax_confirm_message = '{{=T('Are you sure you want to delete this object?')}}'; {{=ASSIGNJS(
var w2p_ajax_disable_with_message = '{{=T('Working...')}}'; w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}'; w2p_ajax_date_format = T('%Y-%m-%d'),
var w2p_ajax_datetime_format = '{{=T('%Y-%m-%d %H:%M:%S')}}'; w2p_ajax_datetime_format = T('%Y-%m-%d %H:%M:%S'),
var ajax_error_500 = '{{=T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars) }}'; ajax_error_500 = T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars)
)}}
//--></script> //--></script>
{{ {{
response.files.insert(0,URL('static','js/jquery.js')) response.files.insert(0,URL('static','js/jquery.js'))
+7 -5
View File
@@ -1,10 +1,12 @@
<script type="text/javascript"><!-- <script type="text/javascript"><!--
// These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below). // These variables are used by the web2py_ajax_init function in web2py_ajax.js (which is loaded below).
var w2p_ajax_confirm_message = '{{=T('Are you sure you want to delete this object?')}}'; {{=ASSIGNJS(
var w2p_ajax_disable_with_message = '{{=T('Working...')}}'; w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}'; w2p_ajax_disable_with_message = T('Working...'),
var w2p_ajax_datetime_format = '{{=T('%Y-%m-%d %H:%M:%S')}}'; w2p_ajax_date_format = T('%Y-%m-%d'),
var ajax_error_500 = '{{=T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars) }}'; w2p_ajax_datetime_format = T('%Y-%m-%d %H:%M:%S'),
ajax_error_500 = T.M('An error occured, please [[reload %s]] the page') % URL(args=request.args, vars=request.get_vars)
)}}
//--></script> //--></script>
{{ {{
response.files.insert(0,URL('static','js/jquery.js')) response.files.insert(0,URL('static','js/jquery.js'))
+1
View File
@@ -31,6 +31,7 @@ class TestAppAdmin(unittest.TestCase):
def setUp(self): def setUp(self):
from gluon.globals import Request, Response, Session, current from gluon.globals import Request, Response, Session, current
from gluon.html import A, DIV, FORM, MENU, TABLE, TR, INPUT, URL, XML from gluon.html import A, DIV, FORM, MENU, TABLE, TR, INPUT, URL, XML
from gluon.html import ASSIGNJS
from gluon.validators import IS_NOT_EMPTY from gluon.validators import IS_NOT_EMPTY
from gluon.compileapp import LOAD from gluon.compileapp import LOAD
from gluon.http import HTTP, redirect from gluon.http import HTTP, redirect