2018-07-07 15:11:27 +02:00
{% extends "base.html" %}
{% block main %}
< section id = "modproduct" >
2024-12-07 15:50:37 +01:00
< h1 > Modify {{ product.name }}< / h1 >
2018-07-07 15:11:27 +02:00
2018-07-09 22:38:39 +02:00
< form id = "modproduct-form" method = "post" action = "/modproduct?change=update" enctype = "multipart/form-data" accept-charset = "UTF-8" >
2024-12-07 15:50:37 +01:00
< label class = "form-label" for = "modproduct-name" > Name: < / label >
< input class = "form-control" id = "modproduct-name" type = "text" name = "name" value = "{{ product.name }}" / > < br / >
2018-07-07 15:11:27 +02:00
2024-12-07 15:50:37 +01:00
< label class = "form-label" for = "modproduct-ean" > EAN code: < / label >
< input class = "form-control" id = "modproduct-ean" type = "text" name = "ean" value = "{{ product.ean or '' }}" / > < br / >
2024-11-23 04:35:05 +01:00
2024-12-07 15:50:37 +01:00
< label class = "form-label" for = "modproduct-price-member" > Member price: < / label >
< div class = "input-group mb-3" >
< span class = "input-group-text" > CHF< / span >
< input class = "form-control" id = "modproduct-price-member" type = "number" step = "0.01" name = "pricemember" value = "{{ product.price_member|chf(False) }}" / >
< / div >
2018-07-07 15:11:27 +02:00
2024-12-07 15:50:37 +01:00
< label class = "form-label" for = "modproduct-price-non-member" > Non-member price: < / label >
< div class = "input-group mb-3" >
< span class = "input-group-text" > CHF< / span >
< input class = "form-control" id = "modproduct-price-non-member" type = "number" step = "0.01" name = "pricenonmember" value = "{{ product.price_non_member|chf(False) }}" / >
< / div >
2018-07-07 15:11:27 +02:00
2021-04-07 09:36:18 +02:00
2024-12-07 15:50:37 +01:00
< div class = "form-check" >
< input class = "form-check-input" id = "modproduct-custom-price" type = "checkbox" name = "custom_price" { % if product . custom_price % } checked = "checked" { % endif % } / >
< label class = "form-check-label" for = "modproduct-custom-price" > < abbr title = "When 'Custom Price' is enabled, users choose the price to pay, but at least the prices given above" > Custom Price< / abbr > < / label >
< / div >
2020-12-28 09:46:51 +01:00
2024-12-07 15:50:37 +01:00
< div class = "form-check" >
< input class = "form-check-input" id = "modproduct-stockable" type = "checkbox" name = "stockable" { % if product . stockable % } checked = "checked" { % endif % } / >
< label class = "form-check-label" for = "modproduct-stockable" > Stockable< / label >
< / div >
2018-07-07 15:11:27 +02:00
2024-12-07 15:50:37 +01:00
< label class = "form-label" for = "modproduct-balance" > Stock: < / label >
< input class = "form-control" id = "modproduct-balance" name = "stock" type = "text" value = "{{ product.stock }}" / > < br / >
< label class = "form-label" for = "modproduct-image" >
2023-03-25 22:51:57 +01:00
< img height = "150" src = "/static/upload/thumbnails/products/{{ product.id }}.png?cacheBuster={{ now }}" alt = "Image of {{ product.name }}" / >
2018-07-07 15:11:27 +02:00
< / label > < br / >
2024-12-07 15:50:37 +01:00
< input class = "form-control" id = "modproduct-image" type = "file" name = "image" accept = "image/*" / > < br / >
2018-07-07 15:11:27 +02:00
< input id = "modproduct-productid" type = "hidden" name = "productid" value = "{{ product.id }}" / > < br / >
2024-12-07 15:50:37 +01:00
< input class = "btn btn-primary" type = "submit" value = "Save changes" >
2018-07-07 15:11:27 +02:00
< / form >
2024-12-07 15:50:37 +01:00
< h2 > Delete Product< / h2 >
2018-07-09 22:38:39 +02:00
< form id = "modproduct-delproduct-form" method = "post" action = "/modproduct?change=del" accept-charset = "UTF-8" >
< input id = "modproduct-delproduct-productid" type = "hidden" name = "productid" value = "{{ product.id }}" / > < br / >
2024-12-07 15:50:37 +01:00
< input class = "btn btn-danger" type = "submit" value = "Delete product {{ product.name }}" / >
2018-07-07 15:11:27 +02:00
< / form >
< / section >
{{ super() }}
{% endblock %}
2024-11-25 23:29:30 +01:00
{% block eanwebsocket %}
let eaninput = document.getElementById("modproduct-ean");
eaninput.value = e.data;
eaninput.select();
eaninput.scrollIntoView();
{% endblock %}