1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Implement a new type of note (see #45)

This commit is contained in:
Yohann D'ANELLO
2020-03-31 01:03:30 +02:00
parent c8854cf45d
commit c384ee02eb
14 changed files with 326 additions and 21 deletions

View File

@ -9,7 +9,7 @@ from django.utils.html import format_html
from django_tables2.utils import A
from django.utils.translation import gettext_lazy as _
from .models.notes import Alias
from .models.notes import Alias, NoteActivity
from .models.transactions import Transaction, TransactionTemplate
from .templatetags.pretty_money import pretty_money
@ -121,6 +121,24 @@ class AliasTable(tables.Table):
attrs={'td': {'class': 'col-sm-1'}})
class NoteActivityTable(tables.Table):
note_name = tables.LinkColumn(
"member:club_linked_note_detail",
args=[A("club.pk"), A("pk")],
)
def render_balance(self, value):
return pretty_money(value)
class Meta:
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
model = NoteActivity
fields = ('note_name', 'balance',)
template_name = 'django_tables2/bootstrap4.html'
class ButtonTable(tables.Table):
class Meta:
attrs = {