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>
|
<td>
|
||||||
<div class="grid-buttons">
|
<div class="grid-buttons">
|
||||||
<button onclick="editProduct({{product.id}})" >📝 Editar</button>
|
<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">
|
<form action="{% url 'onOffproduct' %}" method="post">
|
||||||
{% csrf_token %}
|
{% 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 %}
|
{% if product.active == True %}
|
||||||
<button style="background-color: red;">🚫 Desativar</button>
|
<button style="background-color: red;">🚫 Desativar</button>
|
||||||
@@ -69,15 +71,13 @@ Produtos
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dialog id='Modal-create-product' >
|
<dialog id='Modal-create-product' >
|
||||||
<article >
|
<article >
|
||||||
|
|
||||||
<form action="{% url 'create_product' %}" id="productForm" method="post" >
|
<form action="{% url 'create_product' %}" id="productForm" method="post" >
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<h2>Cadastro de Produto</h2>
|
<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="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="0.01" id="productPrice" name="price" required placeholder="Preço"><br>
|
||||||
<input type="number" step="1" id="productqtd" name="qtd" placeholder="Quantidade"><br>
|
<input type="number" step="1" id="productqtd" name="qtd" placeholder="Quantidade"><br>
|
||||||
|
|||||||
@@ -1260,7 +1260,7 @@ optgroup,
|
|||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1rem;
|
font-size: 0.8rem;
|
||||||
line-height: var(--pico-line-height);
|
line-height: var(--pico-line-height);
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
letter-spacing: inherit;
|
letter-spacing: inherit;
|
||||||
@@ -1268,6 +1268,8 @@ textarea {
|
|||||||
|
|
||||||
input {
|
input {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
/* max-height: 45px; */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
@@ -1960,11 +1962,9 @@ details[open] > summary::after {
|
|||||||
background-position: left center;
|
background-position: left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Card (<article>)
|
|
||||||
*/
|
|
||||||
article {
|
article {
|
||||||
/* margin-bottom: var(--pico-block-spacing-vertical); */
|
margin-bottom: var(--pico-block-spacing-vertical);
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
max-width: 95%;
|
max-width: 95%;
|
||||||
padding: var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);
|
padding: var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);
|
||||||
@@ -1974,7 +1974,7 @@ article {
|
|||||||
transition: transform 0.2s;
|
transition: transform 0.2s;
|
||||||
}
|
}
|
||||||
article:hover {
|
article:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.02);
|
||||||
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
|
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
article > header,
|
article > header,
|
||||||
@@ -2337,9 +2337,9 @@ dialog {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
min-width: 100%;
|
min-width: 70%;
|
||||||
height: inherit;
|
height: inherit;
|
||||||
min-height: 100%;
|
min-height: 70%;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
-webkit-backdrop-filter: var(--pico-modal-overlay-backdrop-filter);
|
-webkit-backdrop-filter: var(--pico-modal-overlay-backdrop-filter);
|
||||||
|
|||||||
@@ -51,7 +51,12 @@ input, textarea {
|
|||||||
border: 1px solid #ccc;
|
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('R$ ', '');
|
||||||
preco = preco.replace(',', '.');
|
preco = preco.replace(',', '.');
|
||||||
productPrice.value = preco;
|
productPrice.value = preco;
|
||||||
// productDescription.value = document.getElementById('description-'+id).innerHTML;
|
productDescription.value = document.getElementById('description-'+id).value;
|
||||||
productqtd.value = document.getElementById('quantity-'+id).innerHTML;
|
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}/`;
|
// const url = `/products/editProduct/${id}/`;
|
||||||
// // window.location.href = url;
|
// // window.location.href = url;
|
||||||
|
|||||||
Reference in New Issue
Block a user