1. Refactoring form objects and database objects to use inheritance and abstract base class for consistency and reduced redundancy.\n2. Contact us page button links updated to resolve error of missing link causing page refresh instead of expected functionality.
This commit is contained in:
37
templates/components/store/_body_home.html
Normal file
37
templates/components/store/_body_home.html
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
{% set block_id = 'styles' %}
|
||||
{% include 'layouts/_shared_store.html' %}
|
||||
<!-- Include Stylesheet -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/store/home.css') }}">
|
||||
|
||||
<!-- HTML content -->
|
||||
<div class="model.FLAG_ROW">
|
||||
<div class="leftcolumn">
|
||||
{% for cat in model.category_list.categories %}
|
||||
{% if cat.is_available() %}
|
||||
{% include 'components/store/_product_category.html' %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="{{ model.ID_BASKET_CONTAINER}}" class="rightcolumn">
|
||||
{% include 'components/store/_basket.html' %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% set block_id = 'scripts' %}
|
||||
{% include 'layouts/_shared_store.html' %}
|
||||
<!-- Include JavaScript -->
|
||||
<script src="{{ url_for('routes_store.scripts_section_store') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/store/home.js') }}"></script>
|
||||
|
||||
<script>
|
||||
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_HOME }}";
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log('Hooking up home page...');
|
||||
hookupStorePageHome();
|
||||
// hookupStore(); // in _shared_store.html
|
||||
});
|
||||
</script>
|
||||
79
templates/components/store/_row_address.html
Normal file
79
templates/components/store/_row_address.html
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
<!-- Address form
|
||||
<div class="card"> -->
|
||||
<form id="{{ form.output_id() }}" class="{{ model.flag_container }}">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
{% if form.form_type_billing_not_delivery %}
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.identical.label }}
|
||||
{{ form.identical(checked=True) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.region.label }}
|
||||
{{ form.region() }}
|
||||
{% for error in form.region.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.name_full.label }}
|
||||
{{ form.name_full(size=100) }}
|
||||
{% for error in form.name_full.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.phone_number.label }}
|
||||
{{ form.phone_number(size=20) }}
|
||||
{% for error in form.phone_number.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.postcode.label }}
|
||||
{{ form.postcode(size=10) }}
|
||||
{% for error in form.postcode.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.address_1.label }}
|
||||
{{ form.address_1(size=254) }}
|
||||
{% for error in form.address_1.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.address_2.label }}
|
||||
{{ form.address_2(size=254) }}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.city.label }}
|
||||
{{ form.city(size=100) }}
|
||||
{% for error in form.city.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.county.label }}
|
||||
{{ form.county(size=100) }}
|
||||
{% for error in form.county.errors %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ form.submit() }}
|
||||
</div>
|
||||
</form>
|
||||
<!--</div>-->
|
||||
18
templates/components/store/_row_basket.html
Normal file
18
templates/components/store/_row_basket.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!-- Basket -->
|
||||
{% set show_delivery_option = False %}
|
||||
<div id="{{ model.ID_BASKET }}" class="{{ model.FLAG_CARD }} {{ model.FLAG_SCROLLABLE }}">
|
||||
<div class="container column">
|
||||
<div class="container row">
|
||||
<h2>Basket</h2>
|
||||
<img class="img-icon" src="{{ url_for('static', filename='images/icon_basket.png')}}" alt="Basket icon">
|
||||
</div>
|
||||
{% for basket_item in model.basket.items %}
|
||||
{% include 'components/store/_basket_item.html' %}
|
||||
{% endfor %}
|
||||
<h3 id="{{ model.ID_BASKET_TOTAL }}">Total: {{ model.output_basket_total() }}</h3>{% if not model.app.is_included_VAT %}<h4> + VAT </h4>{% endif %}
|
||||
<p id="{{ model.ID_LABEL_BASKET_EMPTY }}" style="margin: 1vh;">Buy some shit dawg!</p>
|
||||
<!-- <div id="{{ model.id_basket_notices }}"> include line above
|
||||
</div> -->
|
||||
<button id="{{ model.ID_BUTTON_CHECKOUT }}" type="submit">Checkout</button>
|
||||
</div>
|
||||
</div>
|
||||
35
templates/components/store/_row_basket_item.html
Normal file
35
templates/components/store/_row_basket_item.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!-- Basket Item -->
|
||||
<!-- requires:
|
||||
Basket_Item basket_item
|
||||
bool show_delivery_option
|
||||
-->
|
||||
<div class="container row">
|
||||
{% set product = basket_item.product %}
|
||||
{% set permutation = product.get_permutation_selected() %}
|
||||
<div class="container">
|
||||
<img class="img-thumbnail" src="{{ product.get_image_from_index(0).url }}" alt="Basket icon"> <!-- model.get_many_product_image_src(product.id_product, '', True, 'THUMBNAIL') -->
|
||||
</div>
|
||||
{% set form = product.form_basket_edit %}
|
||||
<!-- <form {{ model.attr_form_type }}="{{ form.form_type }}" {{ model.attr_id_product }}="{{ product.id }}" class="container column" action="{{ url_for('basket_add') }}" method="POST"> -->
|
||||
<form {{ model.attr_form_type }}="{{ form.form_type }}" class="{{ model.flag_container }} {{ model.flag_column }}" {{ model.attr_id_product }}="{{ product.id_product}}" {{ model.attr_id_permutation }}="{{ permutation.id_permutation }}"> <!-- id="form_basket_item_id_{{ basket_item.product.id }}" -->
|
||||
{{ form.hidden_tag() }}
|
||||
<h2>{{ product.name }}</h2>
|
||||
{% if permutation.is_available %}
|
||||
<h3 style="white-space: nowrap;">{{ basket_item.quantity }} x {{ product.output_price(model.app.is_included_VAT) }} = {{ basket_item.output_subtotal() }}</h3>
|
||||
{% set tmp_quantity = basket_item.quantity %}
|
||||
{% include 'components/common/inputs/_input_number_plus_minus.html' %}
|
||||
{% elif permutation.is_unavailable_in_currency_or_region %}
|
||||
<h3 style="white-space: nowrap;">Product not available in currency and region</h3>
|
||||
{% else %}
|
||||
<h3 style="white-space: nowrap;">Product not available</h3>
|
||||
{% endif %}
|
||||
<a class="{{ model.FLAG_DELETE }}">Delete</a>
|
||||
{% if show_delivery_option %}
|
||||
<div class="{{ model.flag_container_input }}">
|
||||
{{ product.form_delivery_option.label }}
|
||||
{{ product.form_delivery_option() }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<script>console.log('creating basket item for:');console.log('product id: {{ product.id_product }}');console.log('permutation id: {{ product.get_id_permutation() }}');console.log('quantity: {{ basket_item.quantity }}');</script>
|
||||
</form>
|
||||
</div>
|
||||
70
templates/components/store/_row_permutation.html
Normal file
70
templates/components/store/_row_permutation.html
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
{% if is_blank_row %}
|
||||
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PERMUTATION }}>
|
||||
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
|
||||
<select class="{{ model.FLAG_PRODUCT_CATEGORY}}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
{% for cat in model.category_list.categories %}
|
||||
<option value="{{ cat.id_category }}">{{ cat.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_PRODUCT }}">
|
||||
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_MIN }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_MAX }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
|
||||
</td>
|
||||
<!-- <td><strong>{ { permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
|
||||
<td class="{{ model.FLAG_DETAIL }}">
|
||||
<a>Detail</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr {{ model.ATTR_ID_PERMUTATION }}="{{ permutation.id_permutation }}">
|
||||
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
|
||||
<select class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"> <!-- {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}" -->
|
||||
{% for c in model.category_list.categories %}
|
||||
<option value="{{ c.id_category }}" {% if c.id_category == category.id_category %}{% endif %}>{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_PRODUCT }}">
|
||||
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_product }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_product }}"> <!-- {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }} -->
|
||||
{% for p in model.category_list.categories[model.category_list.get_index_category_from_id(category.id_category)].products %}
|
||||
<option value="{{ p.id_product }}" {% if p.id_product == product.id_product %}{% endif %}>{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
{% set block_id = 'Textarea_Product_Permutation_Variations' %}
|
||||
{% include 'layouts/_shared_store.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_stock }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_stock }}">
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_MIN }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_min }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_min }}">
|
||||
</td>
|
||||
<td class="{{ model.FLAG_QUANTITY_MAX }}">
|
||||
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.quantity_max }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.quantity_max }}">
|
||||
</td>
|
||||
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
|
||||
<strong>{{ permutation.output_currency() }}</strong>{{ permutation.cost_local }}
|
||||
</td>
|
||||
<!-- <td><strong>{{ permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
|
||||
<td class="{{ model.FLAG_DETAIL }}">
|
||||
<a>Detail</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
45
templates/components/store/_row_product.html
Normal file
45
templates/components/store/_row_product.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% if is_blank_row %}
|
||||
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_CATEGORY }}>
|
||||
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
|
||||
<textarea class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_CATEGORY }} {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View">
|
||||
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="true" {{ model.ATTR_VALUE_PREVIOUS }}="true">
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}">
|
||||
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||
{% set display_order = category.display_order %}
|
||||
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_CODE }}">
|
||||
<textarea class="{{ model.FLAG_CODE }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.code }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.code }}">{{ product.code }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.name }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.name }}">{{ product.name }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
{% include 'components/common/inputs/_textarea_product_variation_types.html' %}
|
||||
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.description }}">{{ product.description }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ product.name_access_level_required }}">
|
||||
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_access_level_required }}">{{ product.name_access_level_required }}</div>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if product.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ product.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.active | lower }}">
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
44
templates/components/store/_row_product_category.html
Normal file
44
templates/components/store/_row_product_category.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% if is_blank_row %}
|
||||
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_CATEGORY }}>
|
||||
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_CODE }}">
|
||||
<textarea class="{{ model.FLAG_CODE }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DESCRIPTION }}">
|
||||
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View">
|
||||
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="true" {{ model.ATTR_VALUE_PREVIOUS }}="true">
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr {{ model.ATTR_ID_PRODUCT_CATEGORY }}="{{ category.id_category }}">
|
||||
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
|
||||
{% set display_order = category.display_order %}
|
||||
{% include 'components/common/buttons/_slider_display_order.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_CODE }}">
|
||||
<textarea class="{{ model.FLAG_CODE }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.code }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.code }}">{{ category.code }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_NAME }}">
|
||||
<textarea class="{{ model.FLAG_NAME }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.name }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.name }}">{{ category.name }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DESCRIPTION }}">
|
||||
<textarea class="{{ model.FLAG_DESCRIPTION }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.description }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.description }}">{{ category.description }}</textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ category.name_access_level_required }}">
|
||||
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="{{ category.id_access_level_required }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_access_level_required }}">{{ category.name_access_level_required }}</div>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if category.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ category.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.active | lower }}">
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
109
templates/components/store/_row_stock_item.html
Normal file
109
templates/components/store/_row_stock_item.html
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
{% if is_blank_row %}
|
||||
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_STOCK_ITEM }}>
|
||||
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
|
||||
<select class="{{ model.FLAG_PRODUCT_CATEGORY}}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
{% for cat in model.category_list.categories %}
|
||||
<option value="{{ cat.id_category }}">{{ cat.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_PRODUCT }}">
|
||||
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
<textarea class="{{ model.FLAG_VARIATIONS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
|
||||
<input class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}" type="number" min="0" value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_PURCHASED }}">
|
||||
<input class="{{ model.FLAG_DATE_PURCHASED }}" type="date" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_RECEIVED }}">
|
||||
<input type="date" class="{{ model.FLAG_DATE_RECEIVED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<!--
|
||||
<td class="{{ model.FLAG_IS_SEALED }}">
|
||||
<input type="checkbox" class="{{ model.FLAG_IS_SEALED }}" "checked" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
-->
|
||||
<td class="{{ model.FLAG_DATE_UNSEALED }}">
|
||||
<input type="date" class="{{ model.FLAG_DATE_UNSEALED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_EXPIRATION }}">
|
||||
<input type="date" class="{{ model.FLAG_DATE_EXPIRATION }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<!--
|
||||
<td class="{{ model.FLAG_IS_CONSUMED }}">
|
||||
<input type="checkbox" class="{{ model.FLAG_IS_CONSUMED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_FALSE }}" {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
-->
|
||||
<td class="{{ model.FLAG_DATE_CONSUMED }}">
|
||||
<input type="date" class="{{ model.FLAG_DATE_CONSUMED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input type="checkbox" class="{{ model.FLAG_ACTIVE }}" "checked" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }} />
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr {{ model.ATTR_ID_STOCK_ITEM }}="{{ stock_item.id_stock_item }}">
|
||||
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}">
|
||||
<select class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ category.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ category.id_category }}"> <!-- {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}" -->
|
||||
{% for c in model.category_list.categories %}
|
||||
<option value="{{ c.id_category }}" {% if c.id_category == category.id_category %}selected{% endif %}>{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_PRODUCT }}">
|
||||
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_product }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_product }}"> <!-- {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }} -->
|
||||
{% for p in model.category_list.categories[model.category_list.get_index_category_from_id(category.id_category)].products %}
|
||||
<option value="{{ p.id_product }}" {% if p.id_product == product.id_product %}selected{% endif %}>{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_VARIATIONS }}">
|
||||
{% set block_id = 'Textarea_Product_Permutation_Variations' %}
|
||||
{% include 'layouts/_shared_store.html' %}
|
||||
</td>
|
||||
<td class="{{ model.FLAG_CURRENCY }}">
|
||||
{{ permutation.output_currency() }}
|
||||
<select class="{{ model.FLAG_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_currency }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_currency }}">
|
||||
{% for currency in model.currency_list.currencies %}
|
||||
<option value="{{ currency.id_currency }}" {% if currency.id_currency == permutation.id_currency %}selected{% endif %}>{{ currency.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">
|
||||
<input type="number" step="0.001" value="{{ stock_item.cost_local_VAT_incl }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.cost_local_VAT_incl }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.cost_local_VAT_incl }}" >
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_PURCHASED }}">
|
||||
<input type="date" value="{{ stock_item.date_purchased }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.date_purchased }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.date_purchased }}" />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_RECEIVED }}">
|
||||
<input type="date" value="{{ stock_item.date_received }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.date_received }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.date_received }}" />
|
||||
</td>
|
||||
<!--
|
||||
<td class="{{ model.FLAG_IS_SEALED }}">
|
||||
<input type="checkbox" {{ "checked" if stock_item.is_sealed else "" }} {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.is_sealed }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.is_sealed }}" />
|
||||
</td>
|
||||
-->
|
||||
<td class="{{ model.FLAG_DATE_UNSEALED }}">
|
||||
<input type="date" value="{{ stock_item.date_unsealed }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.date_unsealed }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.date_unsealed }}" />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_DATE_EXPIRATION }}">
|
||||
<input type="date" value="{{ stock_item.date_expiration }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.date_expiration }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.date_expiration }}" />
|
||||
</td>
|
||||
<!--
|
||||
<td class="{{ model.FLAG_IS_CONSUMED }}">
|
||||
<input type="checkbox" {{ "checked" if stock_item.is_consumed else "" }} {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.is_consumed }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.is_consumed }}" />
|
||||
</td>
|
||||
-->
|
||||
<td class="{{ model.FLAG_DATE_CONSUMED }}">
|
||||
<input type="date" value="{{ stock_item.date_consumed }}" {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.date_consumed }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.date_consumed }}" />
|
||||
</td>
|
||||
<td class="{{ model.FLAG_ACTIVE }}">
|
||||
<input type="checkbox" {{ "checked" if stock_item.active else "" }} {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.active }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.active }}" />
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user