Moved the JavaScript on the account list template to a separated JavaScript file in the accounting application.
This commit is contained in:
parent
1d9a8a0401
commit
d6e68717fd
29
accounting/static/accounting/js/account-list.js
Normal file
29
accounting/static/accounting/js/account-list.js
Normal file
@ -0,0 +1,29 @@
|
||||
/* The Mia Website
|
||||
* account-list.js: The JavaScript for the account list
|
||||
*/
|
||||
|
||||
/* Copyright (c) 2019-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
|
||||
*/
|
||||
|
||||
// Initializes the page JavaScript.
|
||||
$(function () {
|
||||
$('#accounts').DataTable({
|
||||
"ordering": false,
|
||||
});
|
||||
});
|
@ -29,6 +29,7 @@ First written: 2020/7/1
|
||||
{% 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 %}
|
||||
@ -79,12 +80,4 @@ First written: 2020/7/1
|
||||
<p>{{ _("There is currently no data.")|force_escape }}</p>
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#accounts').DataTable({
|
||||
"ordering": false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user