# coding: utf-8
from __future__ import unicode_literals

from django import template
from django.template.defaultfilters import stringfilter

from ..utils import create_thumbs as _create_thumbs


register = template.Library()


@register.filter
@stringfilter
def create_thumbs(value):
    """
    Replace images by thumbs `on fly`
    """
    return _create_thumbs(value)

@@ -139,91 +139,287 @@
 er%0A%0A
-from ..utils import create_thumbs as _create_thumbs%0A%0A%0Aregister = template.Library()
+try:%0A    from django_jinja import library%0Aexcept ImportError:%0A    library = None%0A%0Afrom ..utils import create_thumbs as _create_thumbs%0A%0A%0A# if django_jinja not installed - then use standart template%0Aif library is None:%0A    register = template.Library()%0Aelse:%0A    register = library
 %0A%0A%0A@

add django_jinja support for template tags