Refinex CSV import and PDf export closes #299 and #433 #446

Merged
carla merged 16 commits from feat/299_plz into main 2026-02-24 16:32:32 +01:00
3 changed files with 34 additions and 10 deletions
Showing only changes of commit aaa897c8dc - Show all commits

View file

@ -25,7 +25,7 @@ defmodule MvWeb.ImportLive.Components do
<div>
<p class="text-sm mb-2">
{gettext(
"Use the data field name as the CSV column header in your file. Data fields must exist in Mila before importing, because unknown data field columns will be ignored. Groups and membership fees are not supported for import."
"Use the data field name as the CSV column header in your file. Data fields must exist in Mila before importing, because unknown data field columns will be ignored with a warning. Groups and membership fees are not supported for import."
)}
</p>
<p class="text-sm">

View file

@ -9,7 +9,13 @@
#set page(
paper: "a4",
flipped: true,
margin: (top: 1.2cm, bottom: 1.2cm, left: 1.0cm, right: 1.0cm)
margin: (top: 1.2cm, bottom: 1.2cm, left: 1.0cm, right: 1.0cm),
numbering: "1",
footer: context [
#set text(size: 8pt)
#set align(center)
#counter(page).display("1 / 1", both: true)
]
)
#set text(size: 9pt, hyphenate: true)
@ -58,7 +64,6 @@
#let start = fixed_count + chunk_index * max_dynamic_cols
#let page_cols = fixed_cols + dyn_cols_chunk
#let headers = page_cols.map(c => c.at("label", default: ""))
// widths: first two columns fixed (32mm, 42mm), rest distributed as 1fr
#let widths = (
@ -67,9 +72,9 @@
..((1fr,) * dyn_count)
)
#let header_cells = headers.map(h => text(weight: "bold", size: 9pt)[#h])
#let header_cells = page_cols.map(c => text(weight: "bold", size: 9pt)[#c.at("label", default: "")])
// Body cells (row-major), nur die Spalten dieses Chunks
// Body cells (row-major), only columns of this chunk
#let body_cells = (
rows
.map(row => row.slice(0, fixed_count) + row.slice(start, start + dyn_count))
@ -77,8 +82,27 @@
.flatten()
)
// Thinner grid for body; thicker vertical line between column 2 and 3; header and outer borders thick
#let thin_stroke = 0.3pt + black
#let thick_sep = 1.5pt + black
#let thick_stroke = 1pt + black
#let last_x = fixed_count + dyn_count - 1
#let last_y = rows.len()
#let stroke_fn = (x, y) => {
let top = if y == 0 or y == 1 { thick_stroke } else { thin_stroke }
let bottom = if y == 0 or y == last_y { thick_stroke } else { thin_stroke }
let left = if x == 0 { thick_stroke } else if x == 2 { thick_sep } else { thin_stroke }
let right = if x == last_x { thick_stroke } else { thin_stroke }
(top: top, bottom: bottom, left: left, right: right)
}
// Light gray background for first two columns (first_name, last_name)
#let fill_fn = (x, y) => if x < 2 { rgb("f2f2f2") } else { none }
#table(
columns: widths,
stroke: stroke_fn,
fill: fill_fn,
table.header(..header_cells),
..body_cells,
)