2011-07-31 10:46:29 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from django import template
|
2012-04-14 12:52:56 +02:00
|
|
|
from config.models 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
|
|
|
|
2012-04-16 16:35:30 +02:00
|
|
|
|
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
|
|
|
|
2012-04-16 16:35:30 +02:00
|
|
|
|
2011-07-31 10:46:29 +02:00
|
|
|
@register.simple_tag
|
|
|
|
def active(request, pattern):
|
|
|
|
if request.path.startswith(pattern):
|
|
|
|
return 'selected'
|
|
|
|
return ''
|