Update statement display (cards instead of table)

This commit is contained in:
Edgar P. Burkhart 2024-12-31 15:03:01 +01:00
parent 886e682650
commit 63f1cf4e4d
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
7 changed files with 99 additions and 93 deletions

View file

@ -16,10 +16,6 @@
<h3>{% translate "Statements" %}</h3>
{% include "statement/statement_table.html" %}
</section>
<section>
<h3>{% translate "Transactions" %}</h3>
{% include "transaction/transaction_table.html" %}
</section>
{% if history %}
<section>
<h3>{% translate "History" %}</h3>

View file

@ -35,15 +35,10 @@ class AccountDetailView(NummiDetailView):
pk_url_kwarg = "account"
def get_context_data(self, **kwargs):
_max = 8
_max = 6
data = super().get_context_data(**kwargs)
account = data.get("object")
_transactions = account.transaction_set.all()
if _transactions.count() > _max:
data["transactions_url"] = reverse_lazy(
"account_transactions", args=(account.pk,)
)
_statements = account.statement_set.all()
if _statements.count() > _max:
data["statements_url"] = reverse_lazy(
@ -51,11 +46,10 @@ class AccountDetailView(NummiDetailView):
)
return data | {
"transactions": _transactions[:8],
"new_statement_url": reverse_lazy(
"new_statement", kwargs={"account": account.pk}
),
"statements": _statements[:8],
"statements": _statements[:_max],
"history": history(account.transaction_set),
}