From 92ca835d0e1e2d95f54f3dd915d2f67628652892 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Thu, 26 Mar 2020 17:47:17 +0100 Subject: [PATCH] switch to template column --- apps/note/tables.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/note/tables.py b/apps/note/tables.py index 435907b3..3d8be58e 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -67,7 +67,8 @@ class AliasTable(tables.Table): class Meta: attrs = { 'class': - 'table table condensed table-striped table-hover' + 'table table condensed table-striped table-hover', + 'id':"alias_table" } model = Alias fields = ('name',) @@ -75,15 +76,11 @@ class AliasTable(tables.Table): show_header = False 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', - args=[A('pk')], - attrs={ - 'td': {'class': 'col-sm-2'}, - 'a': {'class': 'btn btn-danger'}}, - text='delete', accessor='pk') + delete = tables.TemplateColumn(template_code=DELETE_TEMPLATE, + extra_context={"delete_trans": _('delete')}, + attrs={'td': {'class': 'col-sm-1'}}) + class ButtonTable(tables.Table):