diff options
Diffstat (limited to 'module/web/pyload')
-rw-r--r-- | module/web/pyload/templatetags/__init__.py | 0 | ||||
-rw-r--r-- | module/web/pyload/templatetags/contains.py | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/module/web/pyload/templatetags/__init__.py b/module/web/pyload/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/module/web/pyload/templatetags/__init__.py diff --git a/module/web/pyload/templatetags/contains.py b/module/web/pyload/templatetags/contains.py new file mode 100644 index 000000000..ed6225a95 --- /dev/null +++ b/module/web/pyload/templatetags/contains.py @@ -0,0 +1,14 @@ +from django import template +register = template.Library() + +@register.filter() +def contains(value, arg): + """ + Usage: + {% if text|contains:" http://" %} + This is a link. + {% else %} + Not a link. + {% endif %} + """ + return arg in value |