From b5d87d2387ae56b42c0e035a256e13ee6fa068b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 3 Feb 2023 12:29:37 +0800 Subject: [PATCH] Revised to allow the viewers to view the account order page. --- src/accounting/account/views.py | 2 +- .../templates/accounting/account/detail.html | 10 ++++++---- .../templates/accounting/account/order.html | 12 +++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/accounting/account/views.py b/src/accounting/account/views.py index e2fd9b0..cb0aad2 100644 --- a/src/accounting/account/views.py +++ b/src/accounting/account/views.py @@ -169,7 +169,7 @@ def delete_account(account: Account) -> redirect: @bp.get("/bases/", endpoint="order") -@has_permission(can_edit) +@has_permission(can_view) def show_account_order(base: BaseAccount) -> str: """Shows the order of the accounts under a same base account. diff --git a/src/accounting/templates/accounting/account/detail.html b/src/accounting/templates/accounting/account/detail.html index d6ffcec..99b79fe 100644 --- a/src/accounting/templates/accounting/account/detail.html +++ b/src/accounting/templates/accounting/account/detail.html @@ -35,10 +35,12 @@ First written: 2023/1/31 {{ A_("Settings") }} - - - {{ A_("Order") }} - + {% endif %} + + + {{ A_("Order") }} + + {% if can_edit_accounting() %} -{% elif base.accounts|length == 1 %} +{% elif base.accounts %} {% else %}

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