fixed table and search

This commit is contained in:
Claudio 2026-01-21 12:10:05 +01:00
parent e876cb9775
commit 49435b8e44
429 changed files with 456 additions and 1 deletions

View File

@ -85,7 +85,61 @@
transition: 0.2s; transition: 0.2s;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); 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” licona */
.dataTables_wrapper .dataTables_filter input {
padding-right: 42px !important;
}
</style> </style>
</head> </head>
<body> <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 === // === EDIT MATRICE ===
$(document).on("click", ".edit", function() { $(document).on("click", ".edit", function() {
$("#idMatriceEdit").val($(this).data("id")); $("#idMatriceEdit").val($(this).data("id"));

View File

@ -79,6 +79,50 @@
text-align: center; text-align: center;
vertical-align: middle; 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> </style>
</head> </head>

View 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()}")

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Some files were not shown because too many files have changed in this diff Show More