Ticket #3199: include_admin_script_with_option2.patch

File include_admin_script_with_option2.patch, 756 bytes (added by Jordi Funollet <jordi.f@…>, 18 years ago)

Same code, better patch format (I hope).

  • django/contrib/admin/templatetags/admin_modify.

    old new  
    2828
    2929        <script type="text/javascript" src="/media/admin/js/calendar.js">
    3030    """
    31 
    32     return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path)
     31    include_tmpl = '<script type="text/javascript" src="%s%s"></script>'
     32    if script_path[0] == '/':
     33        return include_tmpl % (settings.MEDIA_URL, script_path[1:])
     34    else:
     35        return include_tmpl % (settings.ADMIN_MEDIA_PREFIX, script_path)
    3336include_admin_script = register.simple_tag(include_admin_script)
    3437
    3538def submit_row(context):
Back to Top