From 908fbedf0de21667826f6a54676061fdd5c87b6f 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 15:43:21 +0800 Subject: [PATCH] Renamed the URL transactions.show to transactions.detail, teh templates show.html to detail.html, and the view txn_show() to txn_detail, to follow the naming convention of Django in the accounting application. --- accounting/models.py | 6 +++--- accounting/templates/accounting/cash.html | 4 ++-- accounting/templates/accounting/journal.html | 4 ++-- accounting/templates/accounting/ledger.html | 4 ++-- accounting/templates/accounting/search.html | 4 ++-- .../transactions/expense/{view.html => detail.html} | 4 ++-- .../accounting/transactions/expense/form.html | 2 +- .../transactions/income/{view.html => detail.html} | 4 ++-- .../templates/accounting/transactions/income/form.html | 2 +- accounting/templates/accounting/transactions/sort.html | 2 +- .../transactions/transfer/{view.html => detail.html} | 0 .../accounting/transactions/transfer/form.html | 2 +- accounting/urls.py | 2 +- accounting/views.py | 10 +++++----- 14 files changed, 25 insertions(+), 25 deletions(-) rename accounting/templates/accounting/transactions/expense/{view.html => detail.html} (98%) rename accounting/templates/accounting/transactions/income/{view.html => detail.html} (98%) rename accounting/templates/accounting/transactions/transfer/{view.html => detail.html} (100%) diff --git a/accounting/models.py b/accounting/models.py index c9e606c..018787b 100644 --- a/accounting/models.py +++ b/accounting/models.py @@ -156,13 +156,13 @@ class Transaction(DirtyFieldsMixin, models.Model): """Returns the URL to view this transaction.""" if self.is_cash_expense: return reverse( - "accounting:transactions.show", args=("expense", self)) + "accounting:transactions.detail", args=("expense", self)) elif self.is_cash_income: return reverse( - "accounting:transactions.show", args=("income", self)) + "accounting:transactions.detail", args=("income", self)) else: return reverse( - "accounting:transactions.show", args=("transfer", self)) + "accounting:transactions.detail", args=("transfer", self)) def is_dirty(self, **kwargs): """Returns whether the data of this transaction is changed and need diff --git a/accounting/templates/accounting/cash.html b/accounting/templates/accounting/cash.html index 33d40b6..410a7c7 100644 --- a/accounting/templates/accounting/cash.html +++ b/accounting/templates/accounting/cash.html @@ -122,7 +122,7 @@ First written: 2020/7/1 {{ record.balance|accounting_amount }} {% if record.pk is not None %} - + {{ _("View")|force_escape }} @@ -138,7 +138,7 @@ First written: 2020/7/1 {% for record in record_list %}
  • {% if record.pk is not None %} - + diff --git a/accounting/templates/accounting/journal.html b/accounting/templates/accounting/journal.html index 975002b..875e69a 100644 --- a/accounting/templates/accounting/journal.html +++ b/accounting/templates/accounting/journal.html @@ -102,7 +102,7 @@ First written: 2020/7/17 {{ record.transaction.note|default:"" }} {% if record.pk is not None %} - + {{ _("View")|force_escape }} @@ -118,7 +118,7 @@ First written: 2020/7/17 {% for record in record_list %}
  • {% if record.pk is not None %} - +
  • {% if record.pk is not None %} - + diff --git a/accounting/templates/accounting/search.html b/accounting/templates/accounting/search.html index 75ef228..c8c36ae 100644 --- a/accounting/templates/accounting/search.html +++ b/accounting/templates/accounting/search.html @@ -100,7 +100,7 @@ First written: 2020/7/21 {{ record.credit_amount|accounting_amount }} {{ record.transaction.notes|default:"" }} - + {{ _("View")|force_escape }} @@ -114,7 +114,7 @@ First written: 2020/7/21