From 4ccaf01b3cf20649027897071549de9d695f0f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 24 Mar 2023 08:24:47 +0800 Subject: [PATCH] Revised the template of the option detail to be visually different from the option edit form, to avoid confusion. --- .../templates/accounting/option/detail.html | 59 +++++++++++++------ .../detail-recurring-expense-income.html | 31 ---------- .../option/include/detail-recurring-item.html | 28 --------- 3 files changed, 41 insertions(+), 77 deletions(-) delete mode 100644 src/accounting/templates/accounting/option/include/detail-recurring-expense-income.html delete mode 100644 src/accounting/templates/accounting/option/include/detail-recurring-item.html diff --git a/src/accounting/templates/accounting/option/detail.html b/src/accounting/templates/accounting/option/detail.html index 759ab34..1781206 100644 --- a/src/accounting/templates/accounting/option/detail.html +++ b/src/accounting/templates/accounting/option/detail.html @@ -38,26 +38,49 @@ First written: 2023/3/22 -
- - -
+ + + + + + + + + + + +
{{ A_("Default Currency") }}{{ obj.default_currency_text }}
{{ A_("Default Account for the Income and Expenses Log") }}{{ obj.default_ie_account_code_text }}
-
- - -
+

{{ A_("Recurring Expense") }}

-{% with expense_income = "expense", - label = A_("Recurring Expense"), - recurring_items = obj.recurring.expenses %} - {% include "accounting/option/include/detail-recurring-expense-income.html" %} -{% endwith %} +{% if obj.recurring.expenses %} + +{% else %} +

{{ A_("There is no data.") }}

+{% endif %} -{% with expense_income = "income", - label = A_("Recurring Income"), - recurring_items = obj.recurring.incomes %} - {% include "accounting/option/include/detail-recurring-expense-income.html" %} -{% endwith %} +

{{ A_("Recurring Income") }}

+ +{% if obj.recurring.incomes %} + +{% else %} +

{{ A_("There is no data.") }}

+{% endif %} {% endblock %} diff --git a/src/accounting/templates/accounting/option/include/detail-recurring-expense-income.html b/src/accounting/templates/accounting/option/include/detail-recurring-expense-income.html deleted file mode 100644 index 71e3468..0000000 --- a/src/accounting/templates/accounting/option/include/detail-recurring-expense-income.html +++ /dev/null @@ -1,31 +0,0 @@ -{# -The Mia! Accounting Flask Project -detail-recurring-expense-income.html: The recurring expense or income in the option detail - - Copyright (c) 2023 imacat. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Author: imacat@mail.imacat.idv.tw (imacat) -First written: 2023/3/22 -#} -
- - {% if recurring_items %} - - {% endif %} -
diff --git a/src/accounting/templates/accounting/option/include/detail-recurring-item.html b/src/accounting/templates/accounting/option/include/detail-recurring-item.html deleted file mode 100644 index 580ed12..0000000 --- a/src/accounting/templates/accounting/option/include/detail-recurring-item.html +++ /dev/null @@ -1,28 +0,0 @@ -{# -The Mia! Accounting Flask Project -detail-recurring-item.html: The recurring item in the option detail - - Copyright (c) 2023 imacat. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -Author: imacat@mail.imacat.idv.tw (imacat) -First written: 2023/3/22 -#} -{# For SonarQube not to complain about incorrect HTML #}