Prepend all the HTML ID and class names with "accounting-" to avoid name conflict.
This commit is contained in:
@ -41,7 +41,7 @@ First written: 2023/1/31
|
||||
{{ A_("Order") }}
|
||||
</a>
|
||||
{% if accounting_can_edit() %}
|
||||
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#delete-modal">
|
||||
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#accounting-delete-modal">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
{{ A_("Delete") }}
|
||||
</button>
|
||||
@ -49,7 +49,7 @@ First written: 2023/1/31
|
||||
</div>
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.edit", account=obj)|accounting_inherit_next }}">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</a>
|
||||
@ -57,16 +57,16 @@ First written: 2023/1/31
|
||||
{% endif %}
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<form id="delete-form" action="{{ url_for("accounting.account.delete", account=obj) }}" method="post">
|
||||
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<form action="{{ url_for("accounting.account.delete", account=obj) }}" method="post">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<div class="modal fade" id="delete-modal" tabindex="-1" aria-labelledby="delete-model-label" aria-hidden="true">
|
||||
<div class="modal fade" id="accounting-delete-modal" tabindex="-1" aria-labelledby="accounting-delete-model-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="delete-model-label">{{ A_("Delete Account Confirmation") }}</h1>
|
||||
<h1 class="modal-title fs-5" id="accounting-delete-model-label">{{ A_("Delete Account Confirmation") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -82,9 +82,9 @@ First written: 2023/1/31
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div class="account col-sm-6">
|
||||
<div class="account-title">{{ obj.title }}</div>
|
||||
<div class="account-code">{{ obj.code }}</div>
|
||||
<div class="accounting-card col-sm-6">
|
||||
<div class="accounting-card-title">{{ obj.title }}</div>
|
||||
<div class="accounting-card-code">{{ obj.code }}</div>
|
||||
{% if obj.is_offset_needed %}
|
||||
<div>
|
||||
<span class="badge rounded-pill bg-info">{{ A_("Offset needed") }}</span>
|
||||
|
@ -34,16 +34,16 @@ First written: 2023/2/1
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form id="account-form" action="{% block action_url %}{% endblock %}" method="post">
|
||||
<form id="accounting-form" action="{% block action_url %}{% endblock %}" method="post">
|
||||
{{ form.csrf_token }}
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<div class="form-floating mb-3">
|
||||
<input id="account-base-code" type="hidden" name="base_code" value="{{ "" if form.base_code.data is none else form.base_code.data }}">
|
||||
<div id="account-base" class="form-control clickable material-text-field {% if form.base_code.data %} not-empty {% endif %} {% if form.base_code.errors %} is-invalid {% endif %}" data-bs-toggle="modal" data-bs-target="#select-base-modal">
|
||||
<label id="account-base-label" class="form-label" for="account-base">{{ A_("Base account") }}</label>
|
||||
<div id="account-base-content">
|
||||
<input id="accounting-base-code" type="hidden" name="base_code" value="{{ "" if form.base_code.data is none else form.base_code.data }}">
|
||||
<div id="accounting-base" class="form-control accounting-clickable accounting-material-text-field {% if form.base_code.data %} accounting-not-empty {% endif %} {% if form.base_code.errors %} is-invalid {% endif %}" data-bs-toggle="modal" data-bs-target="#accounting-base-selector-model">
|
||||
<label class="form-label" for="accounting-base">{{ A_("Base account") }}</label>
|
||||
<div id="accounting-base-content">
|
||||
{% if form.base_code.data %}
|
||||
{% if form.base_code.errors %}
|
||||
{{ A_("(Unknown)") }}
|
||||
@ -53,18 +53,18 @@ First written: 2023/2/1
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="account-base-code-error" class="invalid-feedback">{% if form.base_code.errors %}{{ form.base_code.errors[0] }}{% endif %}</div>
|
||||
<div id="accounting-base-code-error" class="invalid-feedback">{% if form.base_code.errors %}{{ form.base_code.errors[0] }}{% endif %}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input id="account-title" class="form-control {% if form.title.errors %} is-invalid {% endif %}" type="text" name="title" value="{{ "" if form.title.data is none else form.title.data }}" placeholder=" " required="required">
|
||||
<label class="form-label" for="account-title">{{ A_("Title") }}</label>
|
||||
<div id="account-title-error" class="invalid-feedback">{% if form.title.errors %}{{ form.title.errors[0] }}{% endif %}</div>
|
||||
<input id="accounting-title" class="form-control {% if form.title.errors %} is-invalid {% endif %}" type="text" name="title" value="{{ "" if form.title.data is none else form.title.data }}" placeholder=" " required="required">
|
||||
<label class="form-label" for="accounting-title">{{ A_("Title") }}</label>
|
||||
<div id="accounting-title-error" class="invalid-feedback">{% if form.title.errors %}{{ form.title.errors[0] }}{% endif %}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input id="account-is-offset-needed" class="form-check-input" type="checkbox" name="is_offset_needed" value="1" {% if form.is_offset_needed.data %} checked="checked" {% endif %}>
|
||||
<label class="form-check-label" for="account-is-offset-needed">
|
||||
<input id="accounting-is-offset-needed" class="form-check-input" type="checkbox" name="is_offset_needed" value="1" {% if form.is_offset_needed.data %} checked="checked" {% endif %}>
|
||||
<label class="form-check-label" for="accounting-is-offset-needed">
|
||||
{{ A_("The entries in the account need offsets.") }}
|
||||
</label>
|
||||
</div>
|
||||
@ -76,32 +76,32 @@ First written: 2023/2/1
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fa-solid fa-floppy-disk"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="modal fade" id="select-base-modal" tabindex="-1" aria-labelledby="select-base-model-label" aria-hidden="true">
|
||||
<div class="modal fade" id="accounting-base-selector-model" tabindex="-1" aria-labelledby="accounting-base-selector-model-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="base-selector-model-label">{{ A_("Select Base Account") }}</h1>
|
||||
<h1 class="modal-title fs-5" id="accounting-base-selector-model-label">{{ A_("Select Base Account") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="input-group mb-2">
|
||||
<input id="select-base-query" class="form-control form-control-sm" type="search" placeholder=" " required="required" aria-label="Search">
|
||||
<label class="input-group-text" for="select-base-query">
|
||||
<input id="accounting-base-selector-query" class="form-control form-control-sm" type="search" placeholder=" " required="required" aria-label="Search">
|
||||
<label class="input-group-text" for="accounting-base-selector-query">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
{{ A_("Search") }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<ul class="list-group list-base-selector">
|
||||
<ul class="list-group accounting-selector-list">
|
||||
{% for base in form.base_options %}
|
||||
<li id="list-group-item-base-{{ base.code }}" class="list-group-item list-group-item-base clickable" data-code="{{ base.code }}" data-content="{{ base }}">
|
||||
<li id="accounting-base-option-{{ base.code }}" class="list-group-item accounting-base-option accounting-clickable" data-code="{{ base.code }}" data-content="{{ base }}">
|
||||
{{ base }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
@ -110,9 +110,9 @@ First written: 2023/2/1
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ A_("Cancel") }}</button>
|
||||
{% if form.base_code.data %}
|
||||
<button id="btn-clear-base" type="button" class="btn btn-danger">{{ A_("Clear") }}</button>
|
||||
<button id="accounting-btn-clear-base" type="button" class="btn btn-danger">{{ A_("Clear") }}</button>
|
||||
{% else %}
|
||||
<button id="btn-clear-base" type="button" class="btn btn-secondary" disabled="disabled">{{ A_("Clear") }}</button>
|
||||
<button id="accounting-btn-clear-base" type="button" class="btn btn-secondary" disabled="disabled">{{ A_("Clear") }}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,8 +33,8 @@ First written: 2023/1/30
|
||||
</a>
|
||||
{% endif %}
|
||||
<form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.account.list") }}" method="get" role="search">
|
||||
<input id="search-input" class="form-control form-control-sm search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="search-input" class="search-label">
|
||||
<input id="accounting-search" class="form-control form-control-sm accounting-search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="accounting-search" class="accounting-search-label">
|
||||
<button type="submit">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
{{ A_("Search") }}
|
||||
@ -44,7 +44,7 @@ First written: 2023/1/30
|
||||
</div>
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.account.create")|accounting_append_next }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
|
@ -39,16 +39,16 @@ First written: 2023/2/2
|
||||
|
||||
{% if base.accounts|length > 1 and accounting_can_edit() %}
|
||||
<form action="{{ url_for("accounting.account.sort", base=base) }}" method="post">
|
||||
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<ul id="account-order-list" class="list-group mb-3" data-base-code="{{ base.code }}">
|
||||
<ul id="accounting-order-list" class="list-group mb-3" data-base-code="{{ base.code }}">
|
||||
{% for account in base.accounts|sort(attribute="no") %}
|
||||
<li class="list-group-item d-flex justify-content-between" data-id="{{ account.id }}">
|
||||
<input id="account-order-{{ account.id }}-no" type="hidden" name="{{ account.id }}-no" value="{{ loop.index }}">
|
||||
<input id="accounting-order-{{ account.id }}-no" type="hidden" name="{{ account.id }}-no" value="{{ loop.index }}">
|
||||
<div>
|
||||
<span id="account-order-{{ account.id }}-code">{{ account.code }}</span>
|
||||
<span id="accounting-order-{{ account.id }}-code">{{ account.code }}</span>
|
||||
{{ account.title }}
|
||||
</div>
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
@ -63,7 +63,7 @@ First written: 2023/2/2
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fa-solid fa-floppy-disk"></i>
|
||||
</button>
|
||||
|
@ -32,9 +32,9 @@ First written: 2023/2/1
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="account col-sm-6">
|
||||
<div class="account-title">{{ obj.title }}</div>
|
||||
<div class="account-code">{{ obj.code }}</div>
|
||||
<div class="accounting-card col-sm-6">
|
||||
<div class="accounting-card-title">{{ obj.title }}</div>
|
||||
<div class="accounting-card-code">{{ obj.code }}</div>
|
||||
{% if obj.accounts %}
|
||||
<div>
|
||||
{% for account in obj.accounts %}
|
||||
|
@ -27,8 +27,8 @@ First written: 2023/1/26
|
||||
|
||||
<div class="btn-group mb-2">
|
||||
<form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.base-account.list") }}" method="get" role="search">
|
||||
<input id="search-input" class="form-control form-control-sm search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="search-input" class="search-label">
|
||||
<input id="accounting-search" class="form-control form-control-sm accounting-search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="accounting-search" class="accounting-search-label">
|
||||
<button type="submit">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
{{ A_("Search") }}
|
||||
|
@ -37,7 +37,7 @@ First written: 2023/2/6
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if accounting_can_edit() %}
|
||||
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#delete-modal">
|
||||
<button class="btn btn-danger" type="button" data-bs-toggle="modal" data-bs-target="#accounting-delete-modal">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
{{ A_("Delete") }}
|
||||
</button>
|
||||
@ -45,7 +45,7 @@ First written: 2023/2/6
|
||||
</div>
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.currency.edit", currency=obj)|accounting_inherit_next }}">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</a>
|
||||
@ -53,16 +53,16 @@ First written: 2023/2/6
|
||||
{% endif %}
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<form id="delete-form" action="{{ url_for("accounting.currency.delete", currency=obj) }}" method="post">
|
||||
<input id="csrf_token" type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<form action="{{ url_for("accounting.currency.delete", currency=obj) }}" method="post">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<div class="modal fade" id="delete-modal" tabindex="-1" aria-labelledby="delete-model-label" aria-hidden="true">
|
||||
<div class="modal fade" id="accounting-delete-modal" tabindex="-1" aria-labelledby="accounting-delete-model-label" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="delete-model-label">{{ A_("Delete Currency Confirmation") }}</h1>
|
||||
<h1 class="modal-title fs-5" id="accounting-delete-model-label">{{ A_("Delete Currency Confirmation") }}</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -78,9 +78,9 @@ First written: 2023/2/6
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div class="currency col-sm-6">
|
||||
<div class="currency-name">{{ obj.name }}</div>
|
||||
<div class="currency-code">{{ obj.code }}</div>
|
||||
<div class="accounting-card col-sm-6">
|
||||
<div class="accounting-card-title">{{ obj.name }}</div>
|
||||
<div class="accounting-card-code">{{ obj.code }}</div>
|
||||
<div class="small text-secondary fst-italic">
|
||||
<div>{{ A_("Created") }} {{ obj.created_at }} {{ obj.created_by }}</div>
|
||||
<div>{{ A_("Updated") }} {{ obj.updated_at }} {{ obj.updated_by }}</div>
|
||||
|
@ -34,21 +34,21 @@ First written: 2023/2/6
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form id="currency-form" action="{% block action_url %}{% endblock %}" method="post">
|
||||
<form id="accounting-form" action="{% block action_url %}{% endblock %}" method="post">
|
||||
{{ form.csrf_token }}
|
||||
{% if "next" in request.args %}
|
||||
<input type="hidden" name="next" value="{{ request.args["next"] }}">
|
||||
{% endif %}
|
||||
<div class="form-floating mb-3">
|
||||
<input id="currency-code" class="form-control {% if form.code.errors %} is-invalid {% endif %}" type="text" name="code" value="{{ "" if form.code.data is none else form.code.data }}" placeholder=" " required="required" data-exists-url="{{ url_for("accounting.currency-api.exists") }}" data-original="{% block original_code %}{% endblock %}" data-blocklist="{{ form.CODE_BLOCKLIST|tojson|forceescape }}">
|
||||
<label class="form-label" for="currency-code">{{ A_("Code") }}</label>
|
||||
<div id="currency-code-error" class="invalid-feedback">{% if form.code.errors %}{{ form.code.errors[0] }}{% endif %}</div>
|
||||
<input id="accounting-code" class="form-control {% if form.code.errors %} is-invalid {% endif %}" type="text" name="code" value="{{ "" if form.code.data is none else form.code.data }}" placeholder=" " required="required" data-exists-url="{{ url_for("accounting.currency-api.exists") }}" data-original="{% block original_code %}{% endblock %}" data-blocklist="{{ form.CODE_BLOCKLIST|tojson|forceescape }}">
|
||||
<label class="form-label" for="accounting-code">{{ A_("Code") }}</label>
|
||||
<div id="accounting-code-error" class="invalid-feedback">{% if form.code.errors %}{{ form.code.errors[0] }}{% endif %}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input id="currency-name" class="form-control {% if form.name.errors %} is-invalid {% endif %}" type="text" name="name" value="{{ "" if form.name.data is none else form.name.data }}" placeholder=" " required="required">
|
||||
<label class="form-label" for="currency-name">{{ A_("Name") }}</label>
|
||||
<div id="currency-name-error" class="invalid-feedback">{% if form.name.errors %}{{ form.name.errors[0] }}{% endif %}</div>
|
||||
<input id="accounting-name" class="form-control {% if form.name.errors %} is-invalid {% endif %}" type="text" name="name" value="{{ "" if form.name.data is none else form.name.data }}" placeholder=" " required="required">
|
||||
<label class="form-label" for="accounting-name">{{ A_("Name") }}</label>
|
||||
<div id="accounting-name-error" class="invalid-feedback">{% if form.name.errors %}{{ form.name.errors[0] }}{% endif %}</div>
|
||||
</div>
|
||||
|
||||
<div class="d-none d-md-block">
|
||||
@ -58,7 +58,7 @@ First written: 2023/2/6
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fa-solid fa-floppy-disk"></i>
|
||||
</button>
|
||||
|
@ -33,8 +33,8 @@ First written: 2023/2/6
|
||||
</a>
|
||||
{% endif %}
|
||||
<form class="btn btn-primary d-flex input-group" action="{{ url_for("accounting.currency.list") }}" method="get" role="search">
|
||||
<input id="search-input" class="form-control form-control-sm search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="search-input" class="search-label">
|
||||
<input id="accounting-search" class="form-control form-control-sm accounting-search-input" type="search" name="q" value="{{ request.args["q"] if "q" in request.args else "" }}" placeholder=" " required="required" aria-label="Search">
|
||||
<label for="accounting-search" class="accounting-search-label">
|
||||
<button type="submit">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
{{ A_("Search") }}
|
||||
@ -44,7 +44,7 @@ First written: 2023/2/6
|
||||
</div>
|
||||
|
||||
{% if accounting_can_edit() %}
|
||||
<div class="d-md-none material-fab">
|
||||
<div class="d-md-none accounting-material-fab">
|
||||
<a class="btn btn-primary" href="{{ url_for("accounting.currency.create")|accounting_append_next }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user