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

View File

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