fixed table and search
@ -85,7 +85,61 @@
|
||||
transition: 0.2s;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* === DataTables search: make it stand out === */
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
position: relative;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_filter label {
|
||||
font-weight: 700;
|
||||
color: #1f2d3d;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
justify-content: flex-end;
|
||||
/* search allineato a destra */
|
||||
}
|
||||
|
||||
/* input vero e proprio */
|
||||
.dataTables_wrapper .dataTables_filter input {
|
||||
width: 340px !important;
|
||||
/* più grande */
|
||||
max-width: 100%;
|
||||
padding: 10px 14px !important;
|
||||
border-radius: 12px !important;
|
||||
border: 2px solid #198754 !important;
|
||||
/* verde evidenza */
|
||||
background: #fff !important;
|
||||
box-shadow: 0 6px 18px rgba(25, 135, 84, 0.18);
|
||||
outline: none !important;
|
||||
transition: all .15s ease;
|
||||
}
|
||||
|
||||
/* focus ancora più evidente */
|
||||
.dataTables_wrapper .dataTables_filter input:focus {
|
||||
border-color: #146c43 !important;
|
||||
box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25), 0 10px 22px rgba(25, 135, 84, 0.22) !important;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_filter::after {
|
||||
content: "🔎";
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
opacity: 0.7;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* spazio a destra per non “toccare” l’icona */
|
||||
.dataTables_wrapper .dataTables_filter input {
|
||||
padding-right: 42px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -279,6 +333,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Rendiamo più chiaro il filtro
|
||||
$('#tabellaMatrici_filter label').contents().filter(function() {
|
||||
return this.nodeType === 3; // text node
|
||||
}).first().replaceWith('Cerca: ');
|
||||
|
||||
// Placeholder nell'input
|
||||
$('#tabellaMatrici_filter input')
|
||||
.attr('placeholder', 'Nome matrice, cliente…')
|
||||
.addClass('form-control'); // opzionale: look Bootstrap coerente
|
||||
|
||||
|
||||
// === EDIT MATRICE ===
|
||||
$(document).on("click", ".edit", function() {
|
||||
$("#idMatriceEdit").val($(this).data("id"));
|
||||
|
||||
@ -79,6 +79,50 @@
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* --- FIX colonne lunghe: tronca con ellissi --- */
|
||||
#tabellaMescole {
|
||||
table-layout: fixed;
|
||||
/* fondamentale: rende fisse le larghezze */
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#tabellaMescole th,
|
||||
#tabellaMescole td {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
/* una riga sola */
|
||||
}
|
||||
|
||||
/* Larghezze consigliate (aggiusta se vuoi) */
|
||||
#tabellaMescole th:nth-child(2),
|
||||
#tabellaMescole td:nth-child(2) {
|
||||
/* Nome Mescola */
|
||||
width: 260px;
|
||||
max-width: 260px;
|
||||
}
|
||||
|
||||
#tabellaMescole th:nth-child(3),
|
||||
#tabellaMescole td:nth-child(3) {
|
||||
/* Nome Uscita */
|
||||
width: 260px;
|
||||
max-width: 260px;
|
||||
}
|
||||
|
||||
/* facoltativo: azioni sempre leggibili */
|
||||
#tabellaMescole th:nth-child(5),
|
||||
#tabellaMescole td:nth-child(5) {
|
||||
width: 230px;
|
||||
max-width: 230px;
|
||||
}
|
||||
|
||||
/* ID sempre piccolo */
|
||||
#tabellaMescole th:nth-child(1),
|
||||
#tabellaMescole td:nth-child(1) {
|
||||
width: 70px;
|
||||
max-width: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
134
public/userarea/photos/matrici/collage.py
Normal file
@ -0,0 +1,134 @@
|
||||
from PIL import Image
|
||||
from pathlib import Path
|
||||
|
||||
# =====================
|
||||
# SETTINGS
|
||||
# =====================
|
||||
|
||||
# Folder that contains your source images:
|
||||
# - Use Path("input_images") if you keep a dedicated folder
|
||||
# - Use Path(".") if images are in the same folder as this script
|
||||
INPUT_DIR = Path(".")
|
||||
|
||||
|
||||
OUTPUT_FILE = "collage_5x15.png"
|
||||
|
||||
ROWS = 5
|
||||
COLS = 15
|
||||
REQUIRED = ROWS * COLS
|
||||
|
||||
# Each tile will be resized to this square size (uniform grid)
|
||||
TILE_SIZE = 300 # px
|
||||
|
||||
# Spacing between tiles
|
||||
H_SPACING = 30 # px
|
||||
V_SPACING = 30 # px
|
||||
|
||||
# White background (RGBA)
|
||||
BG_COLOR = (255, 255, 255, 255)
|
||||
|
||||
# "Square-ish" selection threshold:
|
||||
# 1.00 = perfect square, 1.20 = quite strict, 1.35 = more permissive
|
||||
ASPECT_MAX = 1.35
|
||||
|
||||
# Allowed extensions
|
||||
EXTS = {".png", ".jpg", ".jpeg", ".webp"}
|
||||
|
||||
|
||||
# =====================
|
||||
# HELPERS
|
||||
# =====================
|
||||
def list_images(folder: Path):
|
||||
return sorted([p for p in folder.iterdir() if p.is_file() and p.suffix.lower() in EXTS])
|
||||
|
||||
|
||||
def is_squareish(w: int, h: int, aspect_max: float) -> bool:
|
||||
long_side = max(w, h)
|
||||
short_side = min(w, h)
|
||||
if short_side == 0:
|
||||
return False
|
||||
aspect = long_side / short_side
|
||||
return aspect <= aspect_max
|
||||
|
||||
|
||||
def fit_into_square_rgba(img: Image.Image, size: int, bg_color=(255, 255, 255, 255)) -> Image.Image:
|
||||
"""
|
||||
Resize an image preserving aspect ratio and place it centered into a square canvas.
|
||||
"""
|
||||
img = img.convert("RGBA")
|
||||
w, h = img.size
|
||||
|
||||
# Scale to fit inside the square
|
||||
scale = min(size / w, size / h)
|
||||
new_w = max(1, int(w * scale))
|
||||
new_h = max(1, int(h * scale))
|
||||
img = img.resize((new_w, new_h), Image.LANCZOS)
|
||||
|
||||
# Create square tile and paste centered
|
||||
tile = Image.new("RGBA", (size, size), bg_color)
|
||||
x = (size - new_w) // 2
|
||||
y = (size - new_h) // 2
|
||||
tile.paste(img, (x, y), img)
|
||||
return tile
|
||||
|
||||
|
||||
# =====================
|
||||
# MAIN
|
||||
# =====================
|
||||
if not INPUT_DIR.exists():
|
||||
raise SystemExit(f"ERROR: Input folder not found: {INPUT_DIR.resolve()}\n"
|
||||
f"Create it or change INPUT_DIR to Path('.')")
|
||||
|
||||
files = list_images(INPUT_DIR)
|
||||
print(f"Found {len(files)} image files in: {INPUT_DIR.resolve()}")
|
||||
|
||||
if len(files) == 0:
|
||||
raise SystemExit("ERROR: No images found. Check the folder and file extensions (.png/.jpg/.jpeg/.webp).")
|
||||
|
||||
# --- Filter square-ish images ---
|
||||
squareish = []
|
||||
for p in files:
|
||||
with Image.open(p) as im:
|
||||
w, h = im.size
|
||||
if is_squareish(w, h, ASPECT_MAX):
|
||||
squareish.append(p)
|
||||
|
||||
print(f"Square-ish (aspect <= {ASPECT_MAX}): {len(squareish)}")
|
||||
|
||||
if len(squareish) == 0:
|
||||
raise SystemExit(
|
||||
"ERROR: No square-ish images matched.\n"
|
||||
"Try increasing ASPECT_MAX (e.g. 1.50) or verify your images really have a square-ish canvas."
|
||||
)
|
||||
|
||||
# --- Ensure we have exactly REQUIRED tiles (loop/pattern if needed) ---
|
||||
if len(squareish) < REQUIRED:
|
||||
print(f"Not enough square-ish images for {ROWS}x{COLS} ({REQUIRED}). Using loop/pattern to fill.")
|
||||
squareish = (squareish * (REQUIRED // len(squareish) + 1))[:REQUIRED]
|
||||
else:
|
||||
squareish = squareish[:REQUIRED]
|
||||
|
||||
# --- Build tiles (uniform square thumbnails) ---
|
||||
tiles = []
|
||||
for p in squareish:
|
||||
img = Image.open(p)
|
||||
tile = fit_into_square_rgba(img, TILE_SIZE, BG_COLOR)
|
||||
tiles.append(tile)
|
||||
|
||||
# --- Create final canvas ---
|
||||
canvas_w = COLS * TILE_SIZE + (COLS - 1) * H_SPACING
|
||||
canvas_h = ROWS * TILE_SIZE + (ROWS - 1) * V_SPACING
|
||||
canvas = Image.new("RGBA", (canvas_w, canvas_h), BG_COLOR)
|
||||
|
||||
# --- Paste tiles in a grid ---
|
||||
idx = 0
|
||||
for r in range(ROWS):
|
||||
for c in range(COLS):
|
||||
x = c * (TILE_SIZE + H_SPACING)
|
||||
y = r * (TILE_SIZE + V_SPACING)
|
||||
canvas.paste(tiles[idx], (x, y), tiles[idx])
|
||||
idx += 1
|
||||
|
||||
# --- Save output ---
|
||||
canvas.save(OUTPUT_FILE)
|
||||
print(f"✅ Collage created: {Path(OUTPUT_FILE).resolve()}")
|
||||
BIN
public/userarea/photos/matrici/collage_5x15b.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
public/userarea/photos/matrici/input_images/00002P etichetta.png
Normal file
|
After Width: | Height: | Size: 899 B |
BIN
public/userarea/photos/matrici/input_images/00049P.png
Normal file
|
After Width: | Height: | Size: 883 B |
BIN
public/userarea/photos/matrici/input_images/00099P.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/userarea/photos/matrici/input_images/001028C.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00254S.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00292P-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00387C.png
Normal file
|
After Width: | Height: | Size: 924 B |
BIN
public/userarea/photos/matrici/input_images/00394C-2 .png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00407P-1.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00513P-2.png
Normal file
|
After Width: | Height: | Size: 1002 B |
BIN
public/userarea/photos/matrici/input_images/00569P.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 908 B |
BIN
public/userarea/photos/matrici/input_images/00666P.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00669C.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00670P.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/userarea/photos/matrici/input_images/00671Pbis.png
Normal file
|
After Width: | Height: | Size: 457 B |
BIN
public/userarea/photos/matrici/input_images/00672S.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00673P.png
Normal file
|
After Width: | Height: | Size: 401 B |
BIN
public/userarea/photos/matrici/input_images/00673P_final.png
Normal file
|
After Width: | Height: | Size: 401 B |
BIN
public/userarea/photos/matrici/input_images/00673P_trim.png
Normal file
|
After Width: | Height: | Size: 401 B |
BIN
public/userarea/photos/matrici/input_images/00674P.png
Normal file
|
After Width: | Height: | Size: 808 B |
BIN
public/userarea/photos/matrici/input_images/00676P.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00677P.png
Normal file
|
After Width: | Height: | Size: 423 B |
BIN
public/userarea/photos/matrici/input_images/00679P-1.png
Normal file
|
After Width: | Height: | Size: 767 B |
BIN
public/userarea/photos/matrici/input_images/00679P.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00680C.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00681S.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
public/userarea/photos/matrici/input_images/00682P.png
Normal file
|
After Width: | Height: | Size: 852 B |
BIN
public/userarea/photos/matrici/input_images/00684P.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00685P-1.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00686S.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00687C.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00689S.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/userarea/photos/matrici/input_images/00690S.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00691S.png
Normal file
|
After Width: | Height: | Size: 572 B |
BIN
public/userarea/photos/matrici/input_images/00692S.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00693C.png
Normal file
|
After Width: | Height: | Size: 1023 B |
BIN
public/userarea/photos/matrici/input_images/00695S.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00696C.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00698C.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00700P-1.png
Normal file
|
After Width: | Height: | Size: 948 B |
BIN
public/userarea/photos/matrici/input_images/00700P.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00701C.png
Normal file
|
After Width: | Height: | Size: 855 B |
BIN
public/userarea/photos/matrici/input_images/00702S.png
Normal file
|
After Width: | Height: | Size: 840 B |
BIN
public/userarea/photos/matrici/input_images/00703C-1.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/userarea/photos/matrici/input_images/00704P-1 DCL.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00705P.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00706P.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00707P.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00708C.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/userarea/photos/matrici/input_images/00709C.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00710P.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00711C.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/userarea/photos/matrici/input_images/00712P.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00713C.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00714S.png
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
public/userarea/photos/matrici/input_images/00716P-2.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00716P-3.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00716P.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00718S.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00722P.png
Normal file
|
After Width: | Height: | Size: 915 B |
BIN
public/userarea/photos/matrici/input_images/00723C.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00724S.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00725P.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/userarea/photos/matrici/input_images/00726C.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00727P.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00728C.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00729P.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00731C.png
Normal file
|
After Width: | Height: | Size: 833 B |
BIN
public/userarea/photos/matrici/input_images/00732P.png
Normal file
|
After Width: | Height: | Size: 644 B |
BIN
public/userarea/photos/matrici/input_images/00734P.png
Normal file
|
After Width: | Height: | Size: 310 B |
BIN
public/userarea/photos/matrici/input_images/00735P.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/userarea/photos/matrici/input_images/00737P.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/userarea/photos/matrici/input_images/00738P.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/userarea/photos/matrici/input_images/00739P.png
Normal file
|
After Width: | Height: | Size: 861 B |
BIN
public/userarea/photos/matrici/input_images/00740C-1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00747P.png
Normal file
|
After Width: | Height: | Size: 913 B |
BIN
public/userarea/photos/matrici/input_images/00749P.png
Normal file
|
After Width: | Height: | Size: 410 B |
BIN
public/userarea/photos/matrici/input_images/00750P.png
Normal file
|
After Width: | Height: | Size: 543 B |
BIN
public/userarea/photos/matrici/input_images/00751P.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/userarea/photos/matrici/input_images/00752P.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/userarea/photos/matrici/input_images/00753S.png
Normal file
|
After Width: | Height: | Size: 694 B |
BIN
public/userarea/photos/matrici/input_images/00754S.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
public/userarea/photos/matrici/input_images/00755P.png
Normal file
|
After Width: | Height: | Size: 1005 B |
BIN
public/userarea/photos/matrici/input_images/00756P.png
Normal file
|
After Width: | Height: | Size: 549 B |
BIN
public/userarea/photos/matrici/input_images/00757P.png
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
public/userarea/photos/matrici/input_images/00758C.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
public/userarea/photos/matrici/input_images/00759S.png
Normal file
|
After Width: | Height: | Size: 1012 B |
BIN
public/userarea/photos/matrici/input_images/00760P.png
Normal file
|
After Width: | Height: | Size: 940 B |
BIN
public/userarea/photos/matrici/input_images/00761P-1.png
Normal file
|
After Width: | Height: | Size: 398 B |
BIN
public/userarea/photos/matrici/input_images/00761P.png
Normal file
|
After Width: | Height: | Size: 417 B |
BIN
public/userarea/photos/matrici/input_images/00763P-1.png
Normal file
|
After Width: | Height: | Size: 374 B |
BIN
public/userarea/photos/matrici/input_images/00763P.png
Normal file
|
After Width: | Height: | Size: 383 B |
BIN
public/userarea/photos/matrici/input_images/00765P.png
Normal file
|
After Width: | Height: | Size: 910 B |
BIN
public/userarea/photos/matrici/input_images/00766P.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/userarea/photos/matrici/input_images/00767S.png
Normal file
|
After Width: | Height: | Size: 746 B |