This commit is contained in:
Mateusz Gruszczyński
2026-08-20 19:40:27 +02:00
parent ff8f197832
commit 7fc18c48a7
6 changed files with 43 additions and 11 deletions
+3 -1
View File
@@ -11,4 +11,6 @@ db/shopping.db
*.swp
version.txt
deploy/varnish/default.vcl
*.zip
*.zip
shopping_app/uploads/.uploads
!shopping_app/uploads/*
+29
View File
@@ -1739,6 +1739,28 @@ input[type="checkbox"].form-check-input,
.drag-handle {
display: none !important;
align-items: center;
justify-content: center;
flex: 0 0 1.25rem;
width: 1.25rem;
min-width: 1.25rem;
height: 2.35rem;
margin: 0 -.25rem 0 0;
padding: 0 !important;
border: 0 !important;
border-radius: 0 !important;
background: transparent !important;
box-shadow: none !important;
color: currentColor;
opacity: .78;
font: inherit;
font-size: 1.55rem;
font-weight: 700;
line-height: 1;
appearance: none;
-webkit-appearance: none;
user-select: none;
touch-action: none;
cursor: grab;
}
@@ -1746,6 +1768,13 @@ body.sorting-active .drag-handle {
display: inline-flex !important;
}
body.sorting-active .drag-handle:hover,
body.sorting-active .drag-handle:focus-visible {
opacity: 1;
background: transparent !important;
box-shadow: none !important;
}
body.sorting-active .shopping-item-row {
cursor: grab;
}
+4 -5
View File
@@ -443,6 +443,9 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
const iconBtn = 'btn btn-outline-light btn-sm shopping-action-btn';
const wideBtn = 'btn btn-outline-light btn-sm shopping-action-btn shopping-action-btn--wide';
const dragHandleButton = canEditListItem
? `<button type="button" class="drag-handle" title="Przeciągnij produkt" aria-label="Przeciągnij produkt" ${isArchived ? 'disabled' : ''}>⠿</button>`
: '';
const itemNameHtml = canEditListItem
? `<button type="button"
id="name-${item.id}"
@@ -456,12 +459,7 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
let actionButtons = '';
if (canEditListItem) {
const dragHandleButton = window.isSorting
? `<button type="button" class="${iconBtn} drag-handle" title="Przesuń produkt" aria-label="Przesuń produkt" ${isArchived ? 'disabled' : ''}>☰</button>`
: '';
actionButtons += `
${dragHandleButton}
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick='openEditItemModal(event, ${item.id}, ${JSON.stringify(String(item.name || ''))}, ${quantityValue}, ${JSON.stringify(quantityUnit)})'`}>✏️</button>
<button type="button" class="${iconBtn}" ${isArchived ? 'disabled' : `onclick="deleteItem(${item.id})"`}>🗑️</button>`;
}
@@ -486,6 +484,7 @@ function renderItem(item, isShare = window.IS_SHARE, optionsOrShowEditOnly = fal
li.innerHTML = `
<div class="shopping-item-main">
${dragHandleButton}
${checkboxHtml}
<div class="shopping-item-content">
<div class="shopping-item-head">
+5 -2
View File
@@ -120,6 +120,9 @@
data-is-share="{{ 'true' if is_share else 'false' }}">
<div class="shopping-item-main">
{% if not is_share %}
<button type="button" class="drag-handle" title="Przeciągnij produkt" aria-label="Przeciągnij produkt" hidden aria-hidden="true" {% if list.is_archived %}disabled{% endif %}></button>
{% endif %}
<input id="checkbox-{{ item.id }}" class="large-checkbox" type="checkbox" {% if item.purchased %}checked{% endif
%} {% if list.is_archived or item.not_purchased %}disabled{% endif %}>
<div class="shopping-item-content">
@@ -198,7 +201,7 @@
<div>
<label for="editItemQuantity" class="form-label">Ilość / waga / objętość</label>
<div class="input-group">
<input type="number" id="editItemQuantity" class="form-control bg-dark text-white border-secondary" min="0.001" step="0.001" required>
<input type="number" id="editItemQuantity" class="form-control bg-dark text-white border-secondary" min="0.001" step="any" required>
<select id="editItemUnit" class="form-select bg-dark text-white border-secondary" style="max-width: 110px;">
<option value="szt">szt</option>
<option value="kg">kg</option>
@@ -235,7 +238,7 @@
<input type="number" id="newQuantity" name="quantity"
class="form-control bg-dark text-white border-secondary shopping-qty-input"
placeholder="Ilość" min="0.001" step="0.001" value="1">
placeholder="Ilość" min="0.001" step="any" value="1">
<select id="newUnit" name="quantity_unit"
class="form-select bg-dark text-white border-secondary shopping-qty-unit"
+2 -2
View File
@@ -103,7 +103,7 @@
<input id="newItem" class="form-control bg-dark text-white border-secondary shopping-product-name-input" placeholder="Dodaj produkt" {% if
not current_user.is_authenticated %}disabled{% endif %}>
<input id="newQuantity" type="number" class="form-control bg-dark text-white border-secondary shopping-qty-input" placeholder="Ilość"
min="0.001" step="0.001" value="1" {% if not current_user.is_authenticated %}disabled{% endif %}>
min="0.001" step="any" value="1" {% if not current_user.is_authenticated %}disabled{% endif %}>
<select id="newUnit" name="quantity_unit"
class="form-select bg-dark text-white border-secondary shopping-qty-unit"
style="max-width: 105px;" {% if not current_user.is_authenticated %}disabled{% endif %}>
@@ -325,7 +325,7 @@
<div>
<label for="editItemQuantity" class="form-label">Ilość / waga / objętość</label>
<div class="input-group">
<input type="number" id="editItemQuantity" class="form-control bg-dark text-white border-secondary" min="0.001" step="0.001" required>
<input type="number" id="editItemQuantity" class="form-control bg-dark text-white border-secondary" min="0.001" step="any" required>
<select id="editItemUnit" class="form-select bg-dark text-white border-secondary" style="max-width: 110px;">
<option value="szt">szt</option>
<option value="kg">kg</option>
-1
View File
@@ -1 +0,0 @@
../uploads