1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-08-05 06:43:56 +02:00

make the CI pass and nicer front

This commit is contained in:
Pierre-antoine Comby
2020-03-25 00:03:48 +01:00
parent 20ea017e96
commit 0411646ae6
3 changed files with 25 additions and 28 deletions

View File

@@ -56,11 +56,12 @@ class HistoryTable(tables.Table):
def render_valid(self, value):
return "" if value else ""
# function delete_button(id) provided in template file
delete_template = """
DELETE_TEMPLATE = """
<button id="{{ record.pk }}" class="btn btn-danger" onclick="delete_button(this.id)"> {{ delete_trans }}</button>
"""
class AliasTable(tables.Table):
class Meta:
attrs = {
@@ -75,7 +76,7 @@ class AliasTable(tables.Table):
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={
@@ -97,16 +98,16 @@ class ButtonTable(tables.Table):
model = TransactionTemplate
edit = tables.LinkColumn('note:template_update',
args=[A('pk')],
attrs={
'td': {'class': 'col-sm-1'},
'a': {'class': 'btn btn-primary'}},
text=_('edit'), accessor='pk')
delete = tables.TemplateColumn(template_code=delete_template,
extra_context={"delete_trans":_('delete')},
attrs={'td':{'class':'col-sm-1'}})
edit = tables.LinkColumn('note:template_update',
args=[A('pk')],
attrs={'td': {'class': 'col-sm-1'},
'a': {'class': 'btn btn-primary'}},
text=_('edit'),
accessor='pk')
delete = tables.TemplateColumn(template_code=DELETE_TEMPLATE,
extra_context={"delete_trans": _('delete')},
attrs={'td': {'class': 'col-sm-1'}})
def render_amount(self, value):
return pretty_money(value)