From fed95675222e6e5a9e26a4ac86d153fa324f4a4e Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 2 Sep 2020 23:49:10 +0200 Subject: [PATCH] Force line breaks on transactions reason in history, but don't wrap dates or amounts --- apps/note/models/transactions.py | 2 +- apps/note/tables.py | 34 +++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index d88be5a6..a4f220bd 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -356,4 +356,4 @@ class MembershipTransaction(Transaction): @property def type(self): - return _('membership transaction') + return _('membership').capitalize() diff --git a/apps/note/tables.py b/apps/note/tables.py index b1d434ae..12ec58a9 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -29,6 +29,7 @@ class HistoryTable(tables.Table): source = tables.Column( attrs={ "td": { + "class": "text-nowrap", "data-toggle": "tooltip", "title": lambda record: _("used alias").capitalize() + " : " + record.source_alias, } @@ -38,15 +39,46 @@ class HistoryTable(tables.Table): destination = tables.Column( attrs={ "td": { + "class": "text-nowrap", "data-toggle": "tooltip", "title": lambda record: _("used alias").capitalize() + " : " + record.destination_alias, } } ) + created_at = tables.DateColumn( + attrs={ + "td": { + "class": "text-nowrap", + }, + } + ) + + amount = tables.Column( + attrs={ + "td": { + "class": "text-nowrap", + }, + } + ) + + reason = tables.Column( + attrs={ + "td": { + "class": "text-break", + }, + } + ) + type = tables.Column() - total = tables.Column() # will use Transaction.total() !! + total = tables.Column( # will use Transaction.total() !! + attrs={ + "td": { + "class": "text-nowrap", + }, + } + ) valid = tables.Column( attrs={