Update statement display (cards instead of table)
This commit is contained in:
parent
886e682650
commit
63f1cf4e4d
7 changed files with 99 additions and 93 deletions
|
@ -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>
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue