Added the "accounting.utils.next_uri" utilities to fixed how the next URI works.
This commit is contained in:
@ -26,12 +26,12 @@ First written: 2023/1/31
|
||||
{% block content %}
|
||||
|
||||
<div class="btn-group mb-3">
|
||||
<a class="btn btn-primary" href="{{ request.args.get("next") or url_for("accounting.account.list") }}">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.list")|or_next }}">
|
||||
<i class="fa-solid fa-circle-chevron-left"></i>
|
||||
{{ A_("Back") }}
|
||||
</a>
|
||||
{% if can_edit_accounting() %}
|
||||
<a class="btn btn-primary d-none d-md-inline" href="{{ url_for("accounting.account.edit", account=obj) + ("?next=" + request.args["next"] if "next" in request.args else "") }}">
|
||||
<a class="btn btn-primary d-none d-md-inline" href="{{ url_for("accounting.account.edit", account=obj)|inherit_next }}">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
{{ A_("Settings") }}
|
||||
</a>
|
||||
@ -44,7 +44,7 @@ First written: 2023/1/31
|
||||
|
||||
{% if can_edit_accounting() %}
|
||||
<div class="d-md-none material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.edit", account=obj) + ("?next=" + request.args["next"] if "next" in request.args else "") }}">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.edit", account=obj)|inherit_next }}">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</a>
|
||||
</div>
|
||||
@ -53,6 +53,9 @@ First written: 2023/1/31
|
||||
{% if can_edit_accounting() %}
|
||||
<form id="delete-form" action="{{ url_for("accounting.account.delete", account=obj) }}" method="post">
|
||||
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<div class="modal fade" id="delete-modal" tabindex="-1" aria-labelledby="delete-model-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
@ -23,6 +23,6 @@ First written: 2023/2/1
|
||||
|
||||
{% block header %}{% block title %}{{ A_("%(account)s Settings", account=account) }}{% endblock %}{% endblock %}
|
||||
|
||||
{% block back_url %}{{ url_for("accounting.account.detail", account=account) + ("?next=" + request.args["next"] if "next" in request.args else "") }}{% endblock %}
|
||||
{% block back_url %}{{ url_for("accounting.account.detail", account=account)|inherit_next }}{% endblock %}
|
||||
|
||||
{% block action_url %}{{ url_for("accounting.account.update", account=account) }}{% endblock %}
|
||||
|
@ -27,14 +27,14 @@ First written: 2023/1/30
|
||||
|
||||
{% if can_edit_accounting() %}
|
||||
<div class="btn-group mb-3 d-none d-md-block">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.create") }}">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.create")|append_next }}">
|
||||
<i class="fa-solid fa-user-plus"></i>
|
||||
{{ A_("New") }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="d-md-none material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.create") }}">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.create")|append_next }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
@ -61,7 +61,7 @@ First written: 2023/1/30
|
||||
|
||||
<div class="list-group">
|
||||
{% for item in list %}
|
||||
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.account.detail", account=item) }}">
|
||||
<a class="list-group-item list-group-item-action" href="{{ url_for("accounting.account.detail", account=item)|append_next }}">
|
||||
{{ item }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user