djangofloor.templatetags.djangofloor
¶
Templatetags for media files, websockets, notifications¶
Various templatetags provided by DjangoFloor.
Deprecated since version 1.0: do not use it
Set the websocket URL with the access token. Allow to access the right topics.
Deprecated since version 1.0: do not use it
Convert a numeric value to “success”, “warning” or “danger”. The two required bounds are given by a string.
Show django.contrib.messages Messages in Metro alert containers. In order to make the alerts dismissable (with the close button), we have to set the jquery parameter too when using the bootstrap_javascript tag. Uses the template
bootstrap3/messages.html
.Parameters: - context – current template context
- style – “notification”, “banner”, “modal” or “system”
Example for your template:
{% df_messages style='banner' %} {% df_messages style='notification' %}
Deprecated since version 1.0: do not use it
Add font-awesome icons in your HTML code
Joins the given path with the MEDIA_URL setting.
Usage:
{% media path [as varname] %}
Examples:
.. code-block:: html
{% media “myapp/css/base.css” %} {% media variable_with_path %} {% media “myapp/css/base.css” as admin_base_css %} {% media variable_with_path as varname %}
Add font-awesome icons in your HTML code
If you want to reuse the template tag in your Python code.