blob: 1a392f9023f7a3eff9454aa15e0565a16ab31aef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from logging import getLogger
from django import template
from django.utils.translation import ugettext
log = getLogger(__name__)
register = template.Library()
@register.filter(name='translate')
def translate(text):
try:
return ugettext(text)
except:
return ""
@register.inclusion_tag('blocks/bootstrap-modal.html')
def bootstrap_modal(winid, title="", content="", size="", edit=False):
if size not in ['xlarge', 'large', 'small']:
size = ""
context_data = {
"id": winid,
"title": title,
"content": content,
"size": size,
"edit": edit
}
return context_data
|