def browserid_css(): """ Returns <link> tags for the optional CSS included with django-browserid. Requires use of the staticfiles app. """ files = [static_url(path) for path in FORM_CSS] tags = ['<link rel="stylesheet" href="{0}" />'.format(path) for path in files] return mark_safe('\n'.join(tags))
def browserid_css(): """ Returns <link> tags for the optional CSS included with django-browserid. Requires use of the staticfiles app. """ files = [static_url(path) for path in FORM_CSS] tags = [ '<link rel="stylesheet" href="{0}" />'.format(path) for path in files ] return mark_safe('\n'.join(tags))
def browserid_js(include_shim=True): """ Returns <script> tags for the JavaScript required by the BrowserID login button. Requires use of the staticfiles app. :param include_shim: A boolean that determines if the persona.org JavaScript shim is included in the output. Useful if you want to minify the button JavaScript using a library like django-compressor that can't handle external JavaScript. """ files = [static_url(path) for path in FORM_JAVASCRIPT] if include_shim: files.append(BROWSERID_SHIM) tags = ['<script type="text/javascript" src="{0}"></script>'.format(path) for path in files] return mark_safe("\n".join(tags))
def browserid_js(include_shim=True): """ Returns <script> tags for the JavaScript required by the BrowserID login button. Requires use of the staticfiles app. :param include_shim: A boolean that determines if the persona.org JavaScript shim is included in the output. Useful if you want to minify the button JavaScript using a library like django-compressor that can't handle external JavaScript. """ files = [static_url(path) for path in FORM_JAVASCRIPT] if include_shim: files.append(BROWSERID_SHIM) tags = [ '<script type="text/javascript" src="{0}"></script>'.format(path) for path in files ] return mark_safe('\n'.join(tags))