Ticket #1834: include_admin_script_doc.diff

File include_admin_script_doc.diff, 830 bytes (added by Matias Hermanrud Fjeld <mhf@…>, 18 years ago)

documentation for the include_admin_script tag

  • contrib/admin/templatetags/admin_modify.py

     
    1818    return '_'.join([s.lower() for s in word_re.findall(name)[:-1]])
    1919
    2020def 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
    2134    return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path)
    2235include_admin_script = register.simple_tag(include_admin_script)
    2336
Back to Top