From a5fddf6006f69a2540fa002bed125e9b90d1be08 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 2 Aug 2010 13:44:26 +0200 Subject: settings fix --- module/web/pyload/templatetags/__init__.py | 0 module/web/pyload/templatetags/contains.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 module/web/pyload/templatetags/__init__.py create mode 100644 module/web/pyload/templatetags/contains.py (limited to 'module/web/pyload') diff --git a/module/web/pyload/templatetags/__init__.py b/module/web/pyload/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb 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 -- cgit v1.2.3