Skip to content

Commit

Permalink
Merge pull request web2py#1482 from niphlod/fix/1407_and_T_v2
Browse files Browse the repository at this point in the history
fixes web2py#1407 passing a properly escaped string
  • Loading branch information
mdipierro authored Sep 30, 2016
2 parents 590a505 + 3a6df38 commit 91b616d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
12 changes: 7 additions & 5 deletions applications/admin/views/web2py_ajax.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script type="text/javascript"><!--
// 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?')}}';
var w2p_ajax_disable_with_message = '{{=T('Working...')}}';
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}';
var 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) }}';
{{=ASSIGNJS(
w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
w2p_ajax_disable_with_message = T('Working...'),
w2p_ajax_date_format = T('%Y-%m-%d'),
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>
{{
response.files.insert(0,URL('static','js/jquery.js'))
Expand Down
11 changes: 6 additions & 5 deletions applications/examples/views/web2py_ajax.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script type="text/javascript"><!--
// 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?')}}';
var w2p_ajax_disable_with_message = '{{=T('Working...')}}';
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}';
var 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) }}';
{{=ASSIGNJS(
w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
w2p_ajax_date_format = T('%Y-%m-%d'),
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>
{{
response.files.insert(0,URL('static','js/jquery.js'))
Expand Down
12 changes: 7 additions & 5 deletions applications/welcome/views/web2py_ajax.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script type="text/javascript"><!--
// 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?')}}';
var w2p_ajax_disable_with_message = '{{=T('Working...')}}';
var w2p_ajax_date_format = '{{=T('%Y-%m-%d')}}';
var 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) }}';
{{=ASSIGNJS(
w2p_ajax_confirm_message = T('Are you sure you want to delete this object?'),
w2p_ajax_disable_with_message = T('Working...'),
w2p_ajax_date_format = T('%Y-%m-%d'),
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>
{{
response.files.insert(0,URL('static','js/jquery.js'))
Expand Down
1 change: 1 addition & 0 deletions gluon/tests/test_appadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class TestAppAdmin(unittest.TestCase):
def setUp(self):
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 ASSIGNJS
from gluon.validators import IS_NOT_EMPTY
from gluon.compileapp import LOAD
from gluon.http import HTTP, redirect
Expand Down

0 comments on commit 91b616d

Please sign in to comment.