feat(JavaScript): Updated architecture for TableBasePage object with static row ID attribute attached for adding ID against each row added to DOM
This commit is contained in:
@@ -37,6 +37,16 @@
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<button class="{{ model.FLAG_NAV_ADMIN_STORE_STRIPE_PRICES }}">Add new Stripe prices</button>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<button class="{{ model.FLAG_NAV_STORE_MANUFACTURING_PURCHASE_ORDERS }}">Manufacturing Purchase Orders</button>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<button class="{{ model.FLAG_NAV_STORE_SUPPLIERS }}">Suppliers</button>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
|
||||
<button class="{{ model.FLAG_NAV_STORE_SUPPLIER_PURCHASE_ORDERS }}">Supplier Purchase Orders</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Include JavaScript
|
||||
|
||||
73
templates/pages/store/_manufacturing_purchase_orders.html
Normal file
73
templates/pages/store/_manufacturing_purchase_orders.html
Normal file
@@ -0,0 +1,73 @@
|
||||
{% extends 'layouts/layout.html' %}
|
||||
|
||||
{% block page_body %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_manufacturing_purchase_orders.bundle.css') }}">
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_manufacturing_purchase_order.filter_manufacturing_purchase_order') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE }}">
|
||||
{{ model.form_filters.active.label }}
|
||||
{{ model.form_filters.active() }}
|
||||
{% for error in model.form_filters.active.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_DATE_FROM }}">
|
||||
{{ model.form_filters.date_from.label }}
|
||||
{{ model.form_filters.date_from() }}
|
||||
{% for error in model.form_filters.date_from.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_DATE_TO }}">
|
||||
{{ model.form_filters.date_to.label }}
|
||||
{{ model.form_filters.date_to() }}
|
||||
{% for error in model.form_filters.date_to.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set block_id = 'buttons_table_default' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</form>
|
||||
|
||||
|
||||
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
<thead>
|
||||
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}">
|
||||
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
|
||||
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">Cost Total VAT Excl.</th>
|
||||
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">Cost Total VAT Incl.</th>
|
||||
<th class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}">Price Total VAT Excl.</th>
|
||||
<th class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}">Price Total VAT Incl.</th>
|
||||
<th class="{{ model.FLAG_ITEMS }}">Items</th>
|
||||
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set is_blank_row = False %}
|
||||
{% for manufacturing_purchase_order in model.manufacturing_purchase_orders %}
|
||||
{% include 'components/store/_row_manufacturing_purchase_order.html' %}
|
||||
{% endfor %}
|
||||
|
||||
{% set is_blank_row = True %}
|
||||
{% include 'components/store/_row_manufacturing_purchase_order.html' %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include 'components/common/temporary/_overlay_confirm.html' %}
|
||||
{% include 'components/common/temporary/_overlay_error.html' %}
|
||||
|
||||
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
|
||||
|
||||
<script>
|
||||
var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }};
|
||||
var manufacturing_purchase_orders = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.manufacturing_purchase_orders) | tojson | safe }};
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -56,19 +56,8 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }} {{ model.FLAG_CONTAINER_INPUT }}">
|
||||
{ { model.form_filters.submit() }}
|
||||
</div>
|
||||
-->
|
||||
{% set block_id = 'buttons_table_default' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
<!--
|
||||
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</form>
|
||||
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
<thead>
|
||||
@@ -77,8 +66,8 @@
|
||||
<th class="{{ model.FLAG_PRODUCT }}">Product</th>
|
||||
<th class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED }}">Variations</th>
|
||||
<th class="{{ model.FLAG_CURRENCY_COST }}">Currency</th>
|
||||
<th class="{{ model.FLAG_COST_LOCAL_VAT_EXCL }}">Cost Local (VAT excl.)</th>
|
||||
<th class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">Cost Local (VAT incl.)</th>
|
||||
<th class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}">Cost Local (VAT excl.)</th>
|
||||
<th class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}">Cost Local (VAT incl.)</th>
|
||||
<th class="{{ model.FLAG_DATE_PURCHASED}}">Date Purchased</th>
|
||||
<th class="{{ model.FLAG_DATE_RECEIVED }}">Date Received</th>
|
||||
<th class="{{ model.FLAG_STORAGE_LOCATION }}">Storage Location</th>
|
||||
|
||||
73
templates/pages/store/_supplier_purchase_orders.html
Normal file
73
templates/pages/store/_supplier_purchase_orders.html
Normal file
@@ -0,0 +1,73 @@
|
||||
{% extends 'layouts/layout.html' %}
|
||||
|
||||
{% block page_body %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_supplier_purchase_orders.bundle.css') }}">
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_supplier_purchase_order.filter_supplier_purchase_order') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE }}">
|
||||
{{ model.form_filters.active.label }}
|
||||
{{ model.form_filters.active() }}
|
||||
{% for error in model.form_filters.active.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_DATE_FROM }}">
|
||||
{{ model.form_filters.date_from.label }}
|
||||
{{ model.form_filters.date_from() }}
|
||||
{% for error in model.form_filters.date_from.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_DATE_TO }}">
|
||||
{{ model.form_filters.date_to.label }}
|
||||
{{ model.form_filters.date_to() }}
|
||||
{% for error in model.form_filters.date_to.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set block_id = 'buttons_table_default' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</form>
|
||||
|
||||
|
||||
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
<thead>
|
||||
<tr class="{{ model.FLAG_SUPPLIER_PURCHASE_ORDER }}">
|
||||
<th class="{{ model.FLAG_SUPPLIER }}">Supplier</th>
|
||||
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
|
||||
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">Cost Total VAT Excl.</th>
|
||||
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">Cost Total VAT Incl.</th>
|
||||
<th class="{{ model.FLAG_ITEMS }}">Items</th>
|
||||
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set is_blank_row = False %}
|
||||
{% for order in model.supplier_purchase_orders %}
|
||||
{% include 'components/store/_row_supplier_purchase_order.html' %}
|
||||
{% endfor %}
|
||||
|
||||
{% set is_blank_row = True %}
|
||||
{% include 'components/store/_row_supplier_purchase_order.html' %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include 'components/common/temporary/_overlay_confirm.html' %}
|
||||
{% include 'components/common/temporary/_overlay_error.html' %}
|
||||
|
||||
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
|
||||
|
||||
<script>
|
||||
var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }};
|
||||
var supplier_purchase_orders = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.supplier_purchase_orders) | tojson | safe }};
|
||||
var suppliers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.suppliers) | tojson | safe }};
|
||||
</script>
|
||||
{% endblock %}
|
||||
66
templates/pages/store/_suppliers.html
Normal file
66
templates/pages/store/_suppliers.html
Normal file
@@ -0,0 +1,66 @@
|
||||
{% extends 'layouts/layout.html' %}
|
||||
|
||||
{% block page_body %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_suppliers.bundle.css') }}">
|
||||
|
||||
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_supplier.filter_supplier') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
|
||||
{{ model.form_filters.hidden_tag() }}
|
||||
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
|
||||
<div class="{{ model.FLAG_CONTAINER_INPUT }} {{ model.FLAG_ROW }} {{ model.FLAG_FILTER }} {{ model.FLAG_ACTIVE }}">
|
||||
{{ model.form_filters.active.label }}
|
||||
{{ model.form_filters.active() }}
|
||||
{% for error in model.form_filters.active.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set block_id = 'buttons_table_default' %}
|
||||
{% include 'components/common/buttons/_buttons_save_cancel.html' %}
|
||||
</form>
|
||||
|
||||
|
||||
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
|
||||
<thead>
|
||||
<tr class="{{ model.FLAG_SUPPLIER }}">
|
||||
<th class="{{ model.FLAG_NAME_COMPANY }}">Company</th>
|
||||
<th class="{{ model.FLAG_NAME_CONTACT }}">Contact Name</th>
|
||||
<th class="{{ model.FLAG_DEPARTMENT_CONTACT }}">Contact Department</th>
|
||||
<th class="{{ model.FLAG_ADDRESS }} {{ model.FLAG_COLLAPSED }}">Address</th>
|
||||
<th class="{{ model.FLAG_PHONE_NUMBER }}">Phone Number</th>
|
||||
<th class="{{ model.FLAG_FAX }}">Fax Number</th>
|
||||
<th class="{{ model.FLAG_EMAIL }}">Email</th>
|
||||
<th class="{{ model.FLAG_WEBSITE }}">Website</th>
|
||||
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
|
||||
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set is_blank_row = False %}
|
||||
{% for supplier in model.suppliers %}
|
||||
{% include 'components/store/_row_supplier.html' %}
|
||||
{% endfor %}
|
||||
|
||||
{% set is_blank_row = True %}
|
||||
{% include 'components/store/_row_supplier.html' %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include 'components/common/temporary/_overlay_confirm.html' %}
|
||||
{% include 'components/common/temporary/_overlay_error.html' %}
|
||||
|
||||
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
|
||||
|
||||
<script>
|
||||
{#
|
||||
var addresses = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.addresses) | tojson | safe }};
|
||||
#}
|
||||
var currencies = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.currencies) | tojson | safe }};
|
||||
var flagDepartmentContact = "{{ model.FLAG_DEPARTMENT_CONTACT }}";
|
||||
var flagNameCompany = "{{ model.FLAG_NAME_COMPANY }}";
|
||||
var flagNameContact = "{{ model.FLAG_NAME_CONTACT }}";
|
||||
var regions = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.regions) | tojson | safe }};
|
||||
var supplierAddresses = {{ model.supplier_addresses | tojson | safe }};
|
||||
var suppliers = {{ model.convert_list_objects_to_dict_json_by_attribute_key_default(model.suppliers) | tojson | safe }};
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user