Added the initial application with the main account list, the pagination, the query, the permission, the localization, the documentation, the test case, and a test demonstration site.
This commit is contained in:
58
src/accounting/templates/accounting/base-account/list.html
Normal file
58
src/accounting/templates/accounting/base-account/list.html
Normal file
@ -0,0 +1,58 @@
|
||||
{#
|
||||
The Mia! Accounting Flask Project
|
||||
list.html: The base account list
|
||||
|
||||
Copyright (c) 2023 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: 2023/1/26
|
||||
#}
|
||||
{% extends "accounting/base.html" %}
|
||||
|
||||
{% block header %}{% block title %}{{ A_("Base Accounts") }}{% endblock %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form action="{{ url_for("accounting.base-account.list") }}" method="get" role="search">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group mb-2">
|
||||
<input id="query" class="form-control form-control-sm" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<button class="input-group-text" type="submit">
|
||||
<label for="query">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
{{ A_("Search") }}
|
||||
</label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if list %}
|
||||
{% include "accounting/include/pagination.html" %}
|
||||
|
||||
<ul class="list-group">
|
||||
{% for item in list %}
|
||||
<li class="list-group-item list-group-item-action">
|
||||
{{ item }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>{{ A_("There is no data.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
27
src/accounting/templates/accounting/base.html
Normal file
27
src/accounting/templates/accounting/base.html
Normal file
@ -0,0 +1,27 @@
|
||||
{#
|
||||
The Mia! Accounting Flask Project
|
||||
base.html: The application-wide base template.
|
||||
|
||||
Copyright (c) 2023 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: 2023/1/27
|
||||
#}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{{ url_for("accounting.babel_catalog") }}"></script>
|
||||
{% block accounting_scripts %}{% endblock %}
|
||||
{% endblock %}
|
37
src/accounting/templates/accounting/include/nav.html
Normal file
37
src/accounting/templates/accounting/include/nav.html
Normal file
@ -0,0 +1,37 @@
|
||||
{#
|
||||
The Mia! Accounting Flask Project
|
||||
nav.html: The navigation menu for the accounting application.
|
||||
|
||||
Copyright (c) 2023 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: 2023/1/26
|
||||
#}
|
||||
{% if can_view_accounting() %}
|
||||
<li class="nav-item dropdown">
|
||||
<span class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
|
||||
<i class="fa-solid fa-gear"></i>
|
||||
{{ A_("Accounting") }}
|
||||
</span>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item {% if request.endpoint.startswith("accounting.base-account.") %} active {% endif %}" href="{{ url_for("accounting.base-account.list") }}">
|
||||
<i class="fa-solid fa-list"></i>
|
||||
{{ A_("Base Accounts") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
56
src/accounting/templates/accounting/include/pagination.html
Normal file
56
src/accounting/templates/accounting/include/pagination.html
Normal file
@ -0,0 +1,56 @@
|
||||
{#
|
||||
The Mia! Accounting Flask Project
|
||||
pagination.html: The pagination navigation bar.
|
||||
|
||||
Copyright (c) 2023 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: 2023/1/26
|
||||
#}
|
||||
{% if pagination.is_needed %}
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination">
|
||||
{% for link in pagination.page_links %}
|
||||
{% if link.uri is none %}
|
||||
<li class="page-item disabled {% if not link.is_for_mobile %} d-none d-md-inline {% endif %}">
|
||||
<span class="page-link">
|
||||
{{ link.text }}
|
||||
</span>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item {% if not link.is_for_mobile %} d-none d-md-inline {% endif %} {% if link.is_current %} active {% endif %}">
|
||||
<a class="page-link" href="{{ link.uri }}">
|
||||
{{ link.text }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li class="page-item d-none d-md-inline active dropdown">
|
||||
<div class="page-link dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{ pagination.page_size }}
|
||||
</div>
|
||||
<ul class="dropdown-menu">
|
||||
{% for link in pagination.page_sizes %}
|
||||
<li>
|
||||
<a class="dropdown-item {% if link.is_current %} active {% endif %}" href="{{ link.uri }}">
|
||||
{{ link.text }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
Reference in New Issue
Block a user