From 4f02dd88da684aa6832dcc852876662eea7c53d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 7 Aug 2020 10:25:29 +0800 Subject: [PATCH] Moved getting the ReportUrl utility from the views to the report chooser template, to simplify the view in the accounting application. --- .../templates/accounting/accounts/index.html | 1 - .../templates/accounting/balance-sheet.html | 2 +- .../templates/accounting/cash-summary.html | 2 +- accounting/templates/accounting/cash.html | 2 +- .../accounting/include/report-chooser.html | 18 ++++++++++-------- .../templates/accounting/income-statement.html | 2 +- accounting/templates/accounting/journal.html | 2 +- .../templates/accounting/ledger-summary.html | 2 +- accounting/templates/accounting/ledger.html | 2 +- .../templates/accounting/trial-balance.html | 2 +- accounting/templatetags/accounting.py | 11 +++++++---- accounting/views.py | 9 --------- 12 files changed, 25 insertions(+), 30 deletions(-) diff --git a/accounting/templates/accounting/accounts/index.html b/accounting/templates/accounting/accounts/index.html index aa6f07b..8fda04b 100644 --- a/accounting/templates/accounting/accounts/index.html +++ b/accounting/templates/accounting/accounts/index.html @@ -37,7 +37,6 @@ First written: 2020/7/1 {{ _("New")|force_escape }} - {% report_url as reports %} {% with current_report_icon="fas fa-list-ol" current_report_title=_("Accounts") %} {% include "accounting/include/report-chooser.html" %} {% endwith %} diff --git a/accounting/templates/accounting/balance-sheet.html b/accounting/templates/accounting/balance-sheet.html index a98d6bb..8caab1a 100644 --- a/accounting/templates/accounting/balance-sheet.html +++ b/accounting/templates/accounting/balance-sheet.html @@ -53,7 +53,7 @@ First written: 2020/7/20 - {% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") %} + {% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") period=period %} {% include "accounting/include/report-chooser.html" %} {% endwith %} + {% report_url cash_account=cash_account ledger_account=ledger_account period=period as report_url %} - {% with current_report_icon="fas fa-file-invoice" current_report_title=_("Income Statement") %} + {% with current_report_icon="fas fa-file-invoice" current_report_title=_("Income Statement") period=period %} {% include "accounting/include/report-chooser.html" %} {% endwith %}