switch to template column

This commit is contained in:
Pierre-antoine Comby 2020-03-26 17:47:17 +01:00
parent 271fab3b75
commit 92ca835d0e
1 changed files with 6 additions and 9 deletions

View File

@ -67,7 +67,8 @@ class AliasTable(tables.Table):
class Meta: class Meta:
attrs = { attrs = {
'class': 'class':
'table table condensed table-striped table-hover' 'table table condensed table-striped table-hover',
'id':"alias_table"
} }
model = Alias model = Alias
fields = ('name',) fields = ('name',)
@ -75,15 +76,11 @@ class AliasTable(tables.Table):
show_header = False show_header = False
name = tables.Column(attrs={'td': {'class': 'text-center'}}) name = tables.Column(attrs={'td': {'class': 'text-center'}})
# delete = tables.TemplateColumn(template_code=delete_template,
# attrs={'td':{'class': 'col-sm-1'}})
delete = tables.LinkColumn('member:user_alias_delete', delete = tables.TemplateColumn(template_code=DELETE_TEMPLATE,
args=[A('pk')], extra_context={"delete_trans": _('delete')},
attrs={ attrs={'td': {'class': 'col-sm-1'}})
'td': {'class': 'col-sm-2'},
'a': {'class': 'btn btn-danger'}},
text='delete', accessor='pk')
class ButtonTable(tables.Table): class ButtonTable(tables.Table):