Ticket #1834: include_admin_script_doc.diff
File include_admin_script_doc.diff, 830 bytes (added by , 18 years ago) |
---|
-
contrib/admin/templatetags/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 """ 22 return a script-tag suitable for including a script from the admin 23 media url. 24 25 example:: 26 27 {% include_admin_script js/calendar.js %} 28 29 could return:: 30 31 <script type="text/javascript" src="/media/admin/js/calendar.js"> 32 """ 33 21 34 return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path) 22 35 include_admin_script = register.simple_tag(include_admin_script) 23 36