From cafa927c077bb3ce024d7b09da704d8540cdf341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 23 Jul 2020 22:22:04 +0800 Subject: [PATCH] Added the back button to the transaction views in the accounting application. --- .../templates/accounting/transactions/expense/show.html | 7 +++++++ .../templates/accounting/transactions/income/show.html | 7 +++++++ .../templates/accounting/transactions/transfer/show.html | 7 +++++++ accounting/templatetags/accounting.py | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/accounting/templates/accounting/transactions/expense/show.html b/accounting/templates/accounting/transactions/expense/show.html index 59bbf52..bfca114 100644 --- a/accounting/templates/accounting/transactions/expense/show.html +++ b/accounting/templates/accounting/transactions/expense/show.html @@ -39,6 +39,13 @@ First written: 2020/7/23 {% endif %} +
+ + + {{ _("Back") }} + +
+
{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}
{{ item.date|smart_date }}
diff --git a/accounting/templates/accounting/transactions/income/show.html b/accounting/templates/accounting/transactions/income/show.html index 960eceb..875c7a0 100644 --- a/accounting/templates/accounting/transactions/income/show.html +++ b/accounting/templates/accounting/transactions/income/show.html @@ -39,6 +39,13 @@ First written: 2020/7/23
{% endif %} +
+ + + {{ _("Back") }} + +
+
{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}
{{ item.date|smart_date }}
diff --git a/accounting/templates/accounting/transactions/transfer/show.html b/accounting/templates/accounting/transactions/transfer/show.html index 6efeb29..ab36000 100644 --- a/accounting/templates/accounting/transactions/transfer/show.html +++ b/accounting/templates/accounting/transactions/transfer/show.html @@ -39,6 +39,13 @@ First written: 2020/7/23
{% endif %} +
+ + + {{ _("Back") }} + +
+
{% trans "Date:" context "Accounting|" as text %}{{ text|force_escape }}
{{ item.date|smart_date }}
diff --git a/accounting/templatetags/accounting.py b/accounting/templatetags/accounting.py index a966943..8f4b850 100644 --- a/accounting/templatetags/accounting.py +++ b/accounting/templatetags/accounting.py @@ -59,4 +59,4 @@ def url_with_return(context, view_name, *args): """ url = reverse(view_name, args=args) return_to = context.request.get_full_path() - return str(UrlBuilder(url).set_param("return-to", return_to)) + return str(UrlBuilder(url).set_param("r", return_to))