OpenSlides/openslides/utils/templatetags/tags.py

22 lines
427 B
Python
Raw Normal View History

2011-07-31 10:46:29 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
2012-02-15 12:04:11 +01:00
from system import config
2011-07-31 10:46:29 +02:00
register = template.Library()
@register.simple_tag
def get_min_supporters():
2012-02-15 12:04:11 +01:00
return config['application_min_supporters']
2011-07-31 10:46:29 +02:00
@register.simple_tag
def get_config(key):
2012-02-15 12:04:11 +01:00
return config[key]
2011-07-31 10:46:29 +02:00
@register.simple_tag
def active(request, pattern):
if request.path.startswith(pattern):
return 'selected'
return ''