Replaced the function-based txn_form and txn_store view with the class-based TransactionFormView in the accounting application.
This commit is contained in:
@ -72,7 +72,7 @@ First written: 2020/7/23
|
||||
<i class="fas fa-chevron-circle-left"></i>
|
||||
{{ _("Back")|force_escape }}
|
||||
</a>
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.edit" "expense" txn as url %}{% url_keep_return url %}">
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.update" "expense" txn as url %}{% url_keep_return url %}">
|
||||
<i class="fas fa-edit"></i>
|
||||
{{ _("Edit")|force_escape }}
|
||||
</a>
|
||||
|
@ -72,7 +72,7 @@ First written: 2020/7/23
|
||||
<i class="fas fa-chevron-circle-left"></i>
|
||||
{{ _("Back")|force_escape }}
|
||||
</a>
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.edit" "income" txn as url %}{% url_keep_return url %}">
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.update" "income" txn as url %}{% url_keep_return url %}">
|
||||
<i class="fas fa-edit"></i>
|
||||
{{ _("Edit")|force_escape }}
|
||||
</a>
|
||||
|
@ -72,7 +72,7 @@ First written: 2020/7/23
|
||||
<i class="fas fa-chevron-circle-left"></i>
|
||||
{{ _("Back")|force_escape }}
|
||||
</a>
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.edit" "transfer" txn as url %}{% url_keep_return url %}">
|
||||
<a class="btn btn-primary" role="button" href="{% url "accounting:transactions.update" "transfer" txn as url %}{% url_keep_return url %}">
|
||||
<i class="fas fa-edit"></i>
|
||||
{{ _("Edit")|force_escape }}
|
||||
</a>
|
||||
|
@ -56,7 +56,7 @@ First written: 2020/7/23
|
||||
<input id="account-option-url" type="hidden" value="{% url "accounting:api.accounts.options" %}" />
|
||||
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
|
||||
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "expense" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.store" "expense" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "expense" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.create" "expense" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">
|
||||
|
@ -56,7 +56,7 @@ First written: 2020/7/23
|
||||
<input id="account-option-url" type="hidden" value="{% url "accounting:api.accounts.options" %}" />
|
||||
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
|
||||
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "income" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.store" "income" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "income" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.create" "income" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">
|
||||
|
@ -56,7 +56,7 @@ First written: 2020/7/23
|
||||
<input id="account-option-url" type="hidden" value="{% url "accounting:api.accounts.options" %}" />
|
||||
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
|
||||
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "transfer" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.store" "transfer" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
<form id="txn-form" action="{% if form.transaction %}{% url "accounting:transactions.update" "transfer" form.transaction as url %}{% url_keep_return url %}{% else %}{% url "accounting:transactions.create" "transfer" as url %}{% url_keep_return url %}{% endif %}" method="post">
|
||||
{% csrf_token %}
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-2">
|
||||
|
Reference in New Issue
Block a user