Ticket #914: admin_modify-mr.py.patch
File admin_modify-mr.py.patch, 888 bytes (added by , 19 years ago) |
---|
-
admin_modify.py
18 18 return '_'.join([s.lower() for s in word_re.findall(name)[:-1]]) 19 19 20 20 def include_admin_script(script_path): 21 return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path) 21 url_pattern = (r'''(?x)((http|https|ftp)://(\w+[:.]?){2,}(/?|[^ \n\r"']+[\w/!?.=#])(?=[\s\.,>)"'\]]))''') 22 if re.match(url_pattern, script_path) or script_path[0] == '/': 23 return '<script type="text/javascript" src="%s"></script>' % (script_path) 24 else: 25 return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path) 22 26 include_admin_script = register.simple_tag(include_admin_script) 23 27 24 28 def submit_row(context):