Added the non_field_errors to the templates of the accounting forms in the accounting application.

This commit is contained in:
依瑪貓 2020-08-08 11:55:56 +08:00
parent 06ab17c3a4
commit 590f4aa46d
3 changed files with 21 additions and 0 deletions

View File

@ -38,6 +38,13 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
</div>
{% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "expense" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "expense" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>

View File

@ -38,6 +38,13 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
</div>
{% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "income" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "income" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>

View File

@ -38,6 +38,13 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
</div>
{% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "transfer" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "transfer" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>