Added encapsulate factory function to get around Django bug #15791
This commit is contained in:
@@ -3,7 +3,7 @@ from django.template import RequestContext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from common.utils import return_type
|
||||
from common.utils import return_type, encapsulate
|
||||
from common.widgets import exists_with_famfam
|
||||
|
||||
from smart_settings.api import settings
|
||||
@@ -28,12 +28,12 @@ def setting_list(request):
|
||||
'hide_link': True,
|
||||
'hide_object': True,
|
||||
'extra_columns': [
|
||||
{'name': _(u'name'), 'attribute': lambda x: mark_safe(u'<span style="font-weight: bold;">%s</span><br>%s' % (x.get('global_name'), x.get('description')))},
|
||||
{'name': _(u'default'), 'attribute': lambda x: return_type(x['default'])},
|
||||
{'name': _(u'value'), 'attribute': lambda x: mark_safe(u'<div class="nowrap">%s %s</div>' % (
|
||||
{'name': _(u'name'), 'attribute': encapsulate(lambda x: mark_safe(u'<span style="font-weight: bold;">%s</span><br>%s' % (x.get('global_name'), x.get('description'))))},
|
||||
{'name': _(u'default'), 'attribute': encapsulate(lambda x: return_type(x['default']))},
|
||||
{'name': _(u'value'), 'attribute': encapsulate(lambda x: mark_safe(u'<div class="nowrap">%s %s</div>' % (
|
||||
return_type(getattr(x['module'], x['name'])),
|
||||
exists_with_famfam(getattr(x['module'], x['name'])) if x['exists'] else ''
|
||||
))
|
||||
)))
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user