Separate detail and edit view for category, update statement page

This commit is contained in:
Edgar P. Burkhart 2024-01-04 16:51:48 +01:00
parent 218a6aca6f
commit 9d50dc7154
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
15 changed files with 120 additions and 96 deletions

View file

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-04 16:04+0100\n"
"POT-Creation-Date: 2024-01-04 16:18+0100\n"
"PO-Revision-Date: 2023-04-22 15:17+0200\n"
"Last-Translator: Edgar P. Burkhart <traduction@edgarpierre.fr>\n"
"Language-Team: \n"
@ -37,19 +37,19 @@ msgstr "Défaut"
msgid "Accounts"
msgstr "Comptes"
#: .\account\templates\account\account_detail.html:15
#: .\account\templates\account\account_detail.html:13
msgid "Edit account"
msgstr "Modifier le compte"
#: .\account\templates\account\account_detail.html:17
#: .\account\templates\account\account_detail.html:16
msgid "Statements"
msgstr "Relevés"
#: .\account\templates\account\account_detail.html:21
#: .\account\templates\account\account_detail.html:20
msgid "Transactions"
msgstr "Transactions"
#: .\account\templates\account\account_detail.html:26
#: .\account\templates\account\account_detail.html:25
msgid "History"
msgstr "Historique"

View file

@ -4,7 +4,6 @@
{% block title %}{{ object }} {{ block.super }}{% endblock %}
{% block link %}
{{ block.super }}
{% css "main/css/form.css" %}
{% css "main/css/table.css" %}
{% css "main/css/plot.css" %}
{% endblock %}

View file

@ -24,31 +24,6 @@ class AccountUpdateView(NummiUpdateView):
form_class = AccountForm
pk_url_kwarg = "account"
def get_context_data(self, **kwargs):
_max = 8
data = super().get_context_data(**kwargs)
account = data["form"].instance
_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(
"account_statements", args=(account.pk,)
)
return data | {
"transactions": _transactions[:8],
"new_statement_url": reverse_lazy(
"new_statement", kwargs={"account": account.pk}
),
"statements": _statements[:8],
"history": history(account.transaction_set),
}
class AccountDeleteView(NummiDeleteView):
model = Account