Changed the CSS and JavaScript libraries from the hard-coded site-specific location to the settings with default to CDN download.

This commit is contained in:
2020-08-29 21:54:12 +08:00
parent d1ef253d9d
commit c0946481dd
14 changed files with 216 additions and 26 deletions

View File

@ -28,7 +28,7 @@ First written: 2020/8/7
{% block settings %}
{% trans "Accounts" context "Accounting" as text %}
{% setvar "title" text %}
{% setvar "use_datatables" True %}
{% add_lib "bootstrap4-datatables" %}
{% static "accounting/js/account-list.js" as file %}{% add_js file %}
{% endblock %}

View File

@ -29,7 +29,7 @@ First written: 2020/7/20
{% block settings %}
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Balance Sheet {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,7 +28,7 @@ First written: 2020/7/1
{% block settings %}
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title prep_period=request.resolver_match.kwargs.period.prep_desc %}Cash Account for {{ account }} {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,7 +28,7 @@ First written: 2020/7/19
{% block settings %}
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Income Statement {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,7 +28,7 @@ First written: 2020/7/17
{% block settings %}
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Journal {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,7 +28,7 @@ First written: 2020/7/16
{% block settings %}
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title prep_period=request.resolver_match.kwargs.period.prep_desc %}Ledger for {{ account }} {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,7 +28,7 @@ First written: 2020/7/19
{% block settings %}
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Trial Balance {{ prep_period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% add_lib "period-chooser" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% endblock %}

View File

@ -28,8 +28,7 @@ First written: 2020/7/23
{% block settings %}
{% setvar "title" _("Cash Expense Transaction") %}
{% setvar "use_jqueryui" True %}
{% static "ext-libs/decimal/decimal.min.js" as file %}{% add_js file %}
{% add_lib "jquery-ui" "decimal-js" %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
{% static "accounting/js/transaction-form.js" as file %}{% add_js file %}

View File

@ -28,8 +28,7 @@ First written: 2020/7/23
{% block settings %}
{% setvar "title" _("Cash Income Transaction") %}
{% setvar "use_jqueryui" True %}
{% static "ext-libs/decimal/decimal.min.js" as file %}{% add_js file %}
{% add_lib "jquery-ui" "decimal-js" %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
{% static "accounting/js/transaction-form.js" as file %}{% add_js file %}

View File

@ -29,7 +29,7 @@ First written: 2020/8/6
{% block settings %}
{% blocktrans asvar title with date=form.date|smart_date %}Reorder the Transactions in {{ date }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_jqueryui" True %}
{% add_lib "jquery-ui" %}
{% static "accounting/css/report.css" as file %}{% add_css file %}
{% static "accounting/css/transactions-sort.css" as file %}{% add_css file %}
{% static "accounting/js/transaction-sort.js" as file %}{% add_js file %}

View File

@ -28,8 +28,7 @@ First written: 2020/7/23
{% block settings %}
{% setvar "title" _("Transfer Transaction") %}
{% setvar "use_jqueryui" True %}
{% static "ext-libs/decimal/decimal.min.js" as file %}{% add_js file %}
{% add_lib "jquery-ui" "decimal-js" %}
{% static "accounting/css/transactions.css" as file %}{% add_css file %}
{% static "accounting/css/summary-helper.css" as file %}{% add_css file %}
{% static "accounting/js/transaction-form.js" as file %}{% add_js file %}

View File

@ -39,12 +39,14 @@ from django.views.decorators.http import require_GET, require_POST
from django.views.generic import ListView, DetailView
from mia_core.period import Period
from mia_core.utils import Pagination, PaginationException
from mia_core.utils import Pagination, PaginationException, add_default_libs
from mia_core.views import DeleteView, FormView, RedirectView
from . import utils
from .forms import AccountForm, TransactionForm, TransactionSortForm
from .models import Record, Transaction, Account
add_default_libs("bootstrap4", "font-awesome-5", "i18n")
@method_decorator(require_GET, name="dispatch")
class CashDefaultView(RedirectView):