djangofloor.templatetags.djangofloor

Templatetags for media files, websockets, notifications

Various templatetags provided by DjangoFloor.

djangofloor.templatetags.djangofloor.df_deprecation(value)[source]

Deprecated since version 1.0: do not use it

djangofloor.templatetags.djangofloor.df_init_websocket(context, *topics)[source]

Set the websocket URL with the access token. Allow to access the right topics.

djangofloor.templatetags.djangofloor.df_inivalue(value)[source]

Deprecated since version 1.0: do not use it

djangofloor.templatetags.djangofloor.df_level(value, bounds='80:95')[source]

Convert a numeric value to “success”, “warning” or “danger”. The two required bounds are given by a string.

djangofloor.templatetags.djangofloor.df_messages(context, style='banner')[source]

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' %}
djangofloor.templatetags.djangofloor.df_window_key(context)[source]

Deprecated since version 1.0: do not use it

djangofloor.templatetags.djangofloor.django_form(form)[source]
djangofloor.templatetags.djangofloor.django_icon(name, color=None)[source]

Add font-awesome icons in your HTML code

djangofloor.templatetags.djangofloor.do_media(parser, token)[source]

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 %}
djangofloor.templatetags.djangofloor.fontawesome_icon(name, prefix='fa', large=False, fixed=False, spin=False, li=False, rotate=None, border=False, color=None)[source]

Add font-awesome icons in your HTML code

djangofloor.templatetags.djangofloor.media(path)[source]

If you want to reuse the template tag in your Python code.