Renamed the template variables in the account list to be more meaningful in the accounting application.

This commit is contained in:
依瑪貓 2020-08-08 14:09:02 +08:00
parent 651f527c86
commit 9686196b91
2 changed files with 8 additions and 7 deletions

View File

@ -45,7 +45,7 @@ First written: 2020/7/1
{% endwith %}
</div>
{% if object_list %}
{% if account_list %}
<table id="accounts" class="table table-striped table-hover">
<thead>
<tr>
@ -55,19 +55,19 @@ First written: 2020/7/1
</tr>
</thead>
<tbody>
{% for object in object_list %}
<tr class="{% if object.is_parent_and_in_use %} table-danger {% endif %}">
<td>{{ object.code }}</td>
{% for account in account_list %}
<tr class="{% if account.is_parent_and_in_use %} table-danger {% endif %}">
<td>{{ account.code }}</td>
<td>
{{ object.title }}
{% if object.is_parent_and_in_use %}
{{ account.title }}
{% if account.is_parent_and_in_use %}
<span class="badge badge-danger badge-pill">
{{ _("Parent Account In Use")|force_escape }}
</span>
{% endif %}
</td>
<td class="actions">
<a href="{% url "accounting:accounts.show" object %}" class="btn btn-info" role="button">
<a href="{% url "accounting:accounts.show" account %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i>
<span class="d-none d-sm-inline">{{ _("View")|force_escape }}</span>
</a>

View File

@ -1042,6 +1042,7 @@ def txn_sort(request, date):
class AccountListView(ListView):
"""The view to list the accounts."""
queryset = Account.objects.order_by("code")
context_object_name = "account_list"
@require_GET