Show 'enabled' column in grid, fix prefix bug for email profiles
This commit is contained in:
parent
9692e389d5
commit
ed4c445fbe
|
@ -40,6 +40,14 @@ from tailbone.views import MasterView, View
|
|||
from tailbone.newgrids import Grid, GridColumn
|
||||
|
||||
|
||||
class BoolGridColumn(GridColumn):
|
||||
|
||||
def render(self, value):
|
||||
if value is None:
|
||||
return ''
|
||||
return 'Yes' if value else 'No'
|
||||
|
||||
|
||||
class EmailListGridColumn(GridColumn):
|
||||
|
||||
def render(self, value):
|
||||
|
@ -95,7 +103,7 @@ class ProfilesView(MasterView):
|
|||
'key': email.key,
|
||||
'fallback_key': email.fallback_key,
|
||||
'description': email.__doc__,
|
||||
'prefix': email.get_prefix(data),
|
||||
'prefix': email.get_prefix(data, magic=False),
|
||||
'subject': email.get_subject(data, render=False),
|
||||
'sender': email.get_sender(),
|
||||
'replyto': email.get_replyto(),
|
||||
|
@ -111,12 +119,14 @@ class ProfilesView(MasterView):
|
|||
GridColumn('prefix'),
|
||||
GridColumn('subject'),
|
||||
EmailListGridColumn('to'),
|
||||
BoolGridColumn('enabled'),
|
||||
]
|
||||
|
||||
g.sorters['key'] = g.make_sorter('key', foldcase=True)
|
||||
g.sorters['prefix'] = g.make_sorter('prefix', foldcase=True)
|
||||
g.sorters['subject'] = g.make_sorter('subject', foldcase=True)
|
||||
g.sorters['to'] = g.make_sorter('to', foldcase=True)
|
||||
g.sorters['enabled'] = g.make_sorter('enabled')
|
||||
g.default_sortkey = 'key'
|
||||
|
||||
# Make edit link visible by default, no "More" actions.
|
||||
|
|
Loading…
Reference in a new issue