mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
modal criar produto usado para editar produto tambem
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -41,10 +41,12 @@ Produtos
|
||||
<td>
|
||||
<div class="grid-buttons">
|
||||
<button onclick="editProduct({{product.id}})" >📝 Editar</button>
|
||||
<input type="hidden" id="h-category-{{product.id}}" value="{{ product.category.id }}">
|
||||
<input type="hidden" id="description-{{product.id}}" value="{{ product.description }}">
|
||||
|
||||
<form action="{% url 'onOffproduct' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id-product" value="{{ product.id }}">
|
||||
<input type="hidden" name="id-product" id="id-{{product.id}}" value="{{ product.id }}">
|
||||
|
||||
{% if product.active == True %}
|
||||
<button style="background-color: red;">🚫 Desativar</button>
|
||||
@@ -69,15 +71,13 @@ Produtos
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<dialog id='Modal-create-product' >
|
||||
<article >
|
||||
|
||||
<form action="{% url 'create_product' %}" id="productForm" method="post" >
|
||||
{% csrf_token %}
|
||||
<h2>Cadastro de Produto</h2>
|
||||
<input type="text" id="productId" name="productId" required hidden ><br>
|
||||
<input type="text" id="productId" name="productId" hidden ><br>
|
||||
<input type="text" id="productName" name="name" required placeholder="Nome"><br>
|
||||
<input type="number" step="0.01" id="productPrice" name="price" required placeholder="Preço"><br>
|
||||
<input type="number" step="1" id="productqtd" name="qtd" placeholder="Quantidade"><br>
|
||||
|
||||
@@ -1260,7 +1260,7 @@ optgroup,
|
||||
select,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-size: 0.8rem;
|
||||
line-height: var(--pico-line-height);
|
||||
font-family: inherit;
|
||||
letter-spacing: inherit;
|
||||
@@ -1268,6 +1268,8 @@ textarea {
|
||||
|
||||
input {
|
||||
overflow: visible;
|
||||
/* max-height: 45px; */
|
||||
|
||||
}
|
||||
|
||||
select {
|
||||
@@ -1960,11 +1962,9 @@ details[open] > summary::after {
|
||||
background-position: left center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card (<article>)
|
||||
*/
|
||||
|
||||
article {
|
||||
/* margin-bottom: var(--pico-block-spacing-vertical); */
|
||||
margin-bottom: var(--pico-block-spacing-vertical);
|
||||
margin: 0px;
|
||||
max-width: 95%;
|
||||
padding: var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);
|
||||
@@ -1974,7 +1974,7 @@ article {
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
article:hover {
|
||||
transform: scale(1.05);
|
||||
transform: scale(1.02);
|
||||
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
article > header,
|
||||
@@ -2337,9 +2337,9 @@ dialog {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: inherit;
|
||||
min-width: 100%;
|
||||
min-width: 70%;
|
||||
height: inherit;
|
||||
min-height: 100%;
|
||||
min-height: 70%;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
-webkit-backdrop-filter: var(--pico-modal-overlay-backdrop-filter);
|
||||
|
||||
@@ -51,7 +51,12 @@ input, textarea {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
|
||||
* dialog {
|
||||
transform: scale(1);
|
||||
/* display: flexbox;
|
||||
max-width: 200;
|
||||
max-height: 400; */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,10 @@ function editProduct(id) {
|
||||
preco = preco.replace('R$ ', '');
|
||||
preco = preco.replace(',', '.');
|
||||
productPrice.value = preco;
|
||||
// productDescription.value = document.getElementById('description-'+id).innerHTML;
|
||||
productDescription.value = document.getElementById('description-'+id).value;
|
||||
productqtd.value = document.getElementById('quantity-'+id).innerHTML;
|
||||
categorie.value = 2;
|
||||
console.log(document.getElementById('h-category-'+id).value)
|
||||
categorie.value = document.getElementById('h-category-'+id).value;
|
||||
|
||||
// const url = `/products/editProduct/${id}/`;
|
||||
// // window.location.href = url;
|
||||
|
||||
Reference in New Issue
Block a user