From 9961a34e84d3a5ab5ad7972dcf9a2547606f84a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 8 Aug 2020 16:34:45 +0800 Subject: [PATCH] Renamed the templates of the transactions to better-follow the Django conventions in the accounting application. --- .../{transactions/sort.html => transaction-sort.html} | 0 .../expense/detail.html => transaction_detail-expense.html} | 0 .../income/detail.html => transaction_detail-income.html} | 0 .../detail.html => transaction_detail-transfer.html} | 0 .../expense/form.html => transaction_form-expense.html} | 0 .../income/form.html => transaction_form-income.html} | 0 .../transfer/form.html => transaction_form-transfer.html} | 0 accounting/views.py | 6 +++--- 8 files changed, 3 insertions(+), 3 deletions(-) rename accounting/templates/accounting/{transactions/sort.html => transaction-sort.html} (100%) rename accounting/templates/accounting/{transactions/expense/detail.html => transaction_detail-expense.html} (100%) rename accounting/templates/accounting/{transactions/income/detail.html => transaction_detail-income.html} (100%) rename accounting/templates/accounting/{transactions/transfer/detail.html => transaction_detail-transfer.html} (100%) rename accounting/templates/accounting/{transactions/expense/form.html => transaction_form-expense.html} (100%) rename accounting/templates/accounting/{transactions/income/form.html => transaction_form-income.html} (100%) rename accounting/templates/accounting/{transactions/transfer/form.html => transaction_form-transfer.html} (100%) diff --git a/accounting/templates/accounting/transactions/sort.html b/accounting/templates/accounting/transaction-sort.html similarity index 100% rename from accounting/templates/accounting/transactions/sort.html rename to accounting/templates/accounting/transaction-sort.html diff --git a/accounting/templates/accounting/transactions/expense/detail.html b/accounting/templates/accounting/transaction_detail-expense.html similarity index 100% rename from accounting/templates/accounting/transactions/expense/detail.html rename to accounting/templates/accounting/transaction_detail-expense.html diff --git a/accounting/templates/accounting/transactions/income/detail.html b/accounting/templates/accounting/transaction_detail-income.html similarity index 100% rename from accounting/templates/accounting/transactions/income/detail.html rename to accounting/templates/accounting/transaction_detail-income.html diff --git a/accounting/templates/accounting/transactions/transfer/detail.html b/accounting/templates/accounting/transaction_detail-transfer.html similarity index 100% rename from accounting/templates/accounting/transactions/transfer/detail.html rename to accounting/templates/accounting/transaction_detail-transfer.html diff --git a/accounting/templates/accounting/transactions/expense/form.html b/accounting/templates/accounting/transaction_form-expense.html similarity index 100% rename from accounting/templates/accounting/transactions/expense/form.html rename to accounting/templates/accounting/transaction_form-expense.html diff --git a/accounting/templates/accounting/transactions/income/form.html b/accounting/templates/accounting/transaction_form-income.html similarity index 100% rename from accounting/templates/accounting/transactions/income/form.html rename to accounting/templates/accounting/transaction_form-income.html diff --git a/accounting/templates/accounting/transactions/transfer/form.html b/accounting/templates/accounting/transaction_form-transfer.html similarity index 100% rename from accounting/templates/accounting/transactions/transfer/form.html rename to accounting/templates/accounting/transaction_form-transfer.html diff --git a/accounting/views.py b/accounting/views.py index 16dc54f..e3e0796 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -809,7 +809,7 @@ class TransactionView(DetailView): return self.request.resolver_match.kwargs["txn"] def get_template_names(self): - return ["accounting/transactions/%s/detail.html" + return ["accounting/transaction_detail-%s.html" % (self.request.resolver_match.kwargs["txn_type"],)] @@ -849,7 +849,7 @@ def txn_edit(request, txn_type, txn=None): new_record_template = json.dumps(render_to_string( "accounting/include/form-record-non-transfer.html", new_record_context)) - return render(request, F"accounting/transactions/{txn_type}/form.html", { + return render(request, F"accounting/transaction_form-{txn_type}.html", { "txn": form, "summary_categories": get_summary_categories, "should_validate": should_validate, @@ -992,7 +992,7 @@ def txn_sort(request, date): if len(transactions) < 2: raise Http404 if request.method != "POST": - return render(request, "accounting/transactions/sort.html", { + return render(request, "accounting/transaction-sort.html", { "txn_list": transactions, "date": date, })