mia-accounting-django/accounting/templates/accounting/account_list.html

84 lines
2.7 KiB
HTML

{% extends "base.html" %}
{% comment %}
The Mia Accounting Application
account_list.html: The template for the account list
Copyright (c) 2020 imacat.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2020/8/7
{% endcomment %}
{% load static %}
{% load i18n %}
{% load mia_core %}
{% load accounting %}
{% block settings %}
{% trans "Accounts" context "Accounting" as text %}
{% setvar "title" text %}
{% setvar "use_datatables" True %}
{% static "accounting/js/account-list.js" as file %}{% add_js file %}
{% endblock %}
{% block content %}
<div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% url "accounting:accounts.create" %}">
<i class="fas fa-plus"></i>
{{ _("New")|force_escape }}
</a>
{% trans "Accounts" context "Accounting" as text %}
{% with current_report_icon="fas fa-list-ol" current_report_title=text %}
{% include "accounting/include/report-chooser.html" %}
{% endwith %}
</div>
{% if account_list %}
<table id="accounts" class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">{{ _("Code")|force_escape }}</th>
<th scope="col">{{ _("Title")|force_escape }}</th>
<th class="actions" scope="col">{{ _("View")|force_escape }}</th>
</tr>
</thead>
<tbody>
{% for account in account_list %}
<tr class="{% if account.is_parent_and_in_use %} table-danger {% endif %}">
<td>{{ account.code }}</td>
<td>
{{ 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.detail" 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>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ _("There is currently no data.")|force_escape }}</p>
{% endif %}
{% endblock %}