Revised to allow the viewers to view the account order page.
This commit is contained in:
parent
784e7bde49
commit
b5d87d2387
@ -169,7 +169,7 @@ def delete_account(account: Account) -> redirect:
|
|||||||
|
|
||||||
|
|
||||||
@bp.get("/bases/<baseAccount:base>", endpoint="order")
|
@bp.get("/bases/<baseAccount:base>", endpoint="order")
|
||||||
@has_permission(can_edit)
|
@has_permission(can_view)
|
||||||
def show_account_order(base: BaseAccount) -> str:
|
def show_account_order(base: BaseAccount) -> str:
|
||||||
"""Shows the order of the accounts under a same base account.
|
"""Shows the order of the accounts under a same base account.
|
||||||
|
|
||||||
|
@ -35,10 +35,12 @@ First written: 2023/1/31
|
|||||||
<i class="fa-solid fa-gear"></i>
|
<i class="fa-solid fa-gear"></i>
|
||||||
{{ A_("Settings") }}
|
{{ A_("Settings") }}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.order", base=obj.base)|append_next }}">
|
<a class="btn btn-primary" href="{{ url_for("accounting.account.order", base=obj.base)|append_next }}">
|
||||||
<i class="fa-solid fa-bars-staggered"></i>
|
<i class="fa-solid fa-bars-staggered"></i>
|
||||||
{{ A_("Order") }}
|
{{ A_("Order") }}
|
||||||
</a>
|
</a>
|
||||||
|
{% if can_edit_accounting() %}
|
||||||
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#delete-modal">
|
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#delete-modal">
|
||||||
<i class="fa-solid fa-trash"></i>
|
<i class="fa-solid fa-trash"></i>
|
||||||
{{ A_("Delete") }}
|
{{ A_("Delete") }}
|
||||||
|
@ -37,7 +37,7 @@ First written: 2023/2/2
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if base.accounts|length > 1 %}
|
{% if base.accounts|length > 1 and can_edit_accounting() %}
|
||||||
<form action="{{ url_for("accounting.account.sort", base=base) }}" method="post">
|
<form action="{{ url_for("accounting.account.sort", base=base) }}" method="post">
|
||||||
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
{% if "next" in request.args %}
|
{% if "next" in request.args %}
|
||||||
@ -69,11 +69,13 @@ First written: 2023/2/2
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% elif base.accounts|length == 1 %}
|
{% elif base.accounts %}
|
||||||
<ul class="list-group mb-3">
|
<ul class="list-group mb-3">
|
||||||
|
{% for account in base.accounts|sort(attribute="no") %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{{ base.accounts[0] }}
|
{{ account }}
|
||||||
</li>
|
</li>
|
||||||
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{{ A_("There is no data.") }}</p>
|
<p>{{ A_("There is no data.") }}</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user