enterprise.templatetags package#

Submodules#

enterprise.templatetags.enterprise module#

Template tags and filters for the Enterprise application.

enterprise.templatetags.enterprise.alert_messages(messages)#

Django template tag that returns an alert message.

Usage:

{% alert_messages messages %}

enterprise.templatetags.enterprise.course_modal(context, course=None)#

Django template tag that returns course information to display in a modal.

You may pass in a particular course if you like. Otherwise, the modal will look for course context within the parent context.

Usage:

{% course_modal %} {% course_modal course %}

enterprise.templatetags.enterprise.expand_button(value, href)#

Django template tag that returns a button used to expand/collapse a container.

You may pass in the ID of the container that this button controls, and a button text value.

Usage:

{% expand_button ‘Click me!’ ‘#id’ %}

enterprise.templatetags.enterprise.fa_icon(message_type)#

Django template tag that returns font awesome icon depending upon message type.

Usage:

{% fa_icon “success” %}

Django template filter that returns an anchor with attributes useful for course modal selection.

General Usage:

{{ link_text|link_to_modal:index }}

Examples

{{ course_title|link_to_modal:forloop.counter0 }} {{ course_title|link_to_modal:3 }} {{ view_details_text|link_to_modal:0 }}

enterprise.templatetags.enterprise.only_safe_html(html_text)#

Django template filter that strips all HTML tags excepts those degined in ALLOWED_TAGS.

General Usage:

{{ html_text|only_safe_html }}

Module contents#