diff --git a/apps/note/tables.py b/apps/note/tables.py index 518173c6..188683dd 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -4,7 +4,7 @@ import html import django_tables2 as tables -from django.utils.html import format_html +from django.utils.html import format_html, mark_safe from django_tables2.utils import A from django.utils.translation import gettext_lazy as _ from note_kfet.middlewares import get_current_request @@ -197,6 +197,16 @@ class ButtonTable(tables.Table): verbose_name=_("Edit"), ) + hideshow = tables.Column( + verbose_name= _("Hide/Show"), + accessor="pk", + attrs= { + 'td': { + 'class': 'col-sm-1', + 'id': lambda record: "hideshow_" + str(record.pk), + } + }) + delete_col = tables.TemplateColumn(template_code=DELETE_TEMPLATE, extra_context={"delete_trans": _('delete')}, attrs={'td': {'class': 'col-sm-1'}}, @@ -204,3 +214,13 @@ class ButtonTable(tables.Table): def render_amount(self, value): return pretty_money(value) + + def render_hideshow(self, record): + val = '' + return mark_safe(val) diff --git a/apps/note/templates/note/transactiontemplate_list.html b/apps/note/templates/note/transactiontemplate_list.html index 2a19922e..b6c95758 100644 --- a/apps/note/templates/note/transactiontemplate_list.html +++ b/apps/note/templates/note/transactiontemplate_list.html @@ -31,29 +31,29 @@ SPDX-License-Identifier: GPL-3.0-or-later {% block extrajavascript %} {% endblock %}