1.4 KiB
1.4 KiB
| 1 | <?lsmb# This is a comment block; it's ignored by the template engine. | ||
|---|---|---|---|
| 2 | Version: 1.2 | ||
| 3 | Date: 2025-05-02 | ||
| 4 | File: display_report.csv | ||
| 5 | Set: demo | ||
| 6 | Template version numbers are explicitly not aligned across templates or | ||
| 7 | releases. No explicit versioning was applied before 2021-01-04. | ||
| 8 | Version Changes | ||
| 9 | 1.1 Merged 'dynatable.csv' into this template | ||
| 10 | 1.2 Fix missing newlines after each row | ||
| 11 | -?> | ||
| 12 | <?lsmb- | ||
| 13 | BLOCK do_quote ; | ||
| 14 | IF VALUE.to_output.defined(); | ||
| 15 | value = VALUE.to_output(); | ||
| 16 | ELSE; | ||
| 17 | value = VALUE; | ||
| 18 | END; | ||
| 19 | IF value.match('[^0-9.+-]'); # any non-digit means run escaping | ||
| 20 | ELSE; | ||
| 21 | value; | ||
| 22 | END; | ||
| 23 | END; | ||
| 24 | BLOCK dynatable; | ||
| 25 | SKIP_TYPES = ['hidden' | 'radio' | 'checkbox']; |
| 26 | FOREACH COL IN columns; | ||
| 27 | IF SKIP_TYPES.grep(COL.type).empty(); | ||
| 28 | UNLESS loop.first(); | ||
| 29 | ' | '; | |
| 30 | END; | ||
| 31 | INCLUDE do_quote VALUE = COL.name; | ||
| 32 | END; | ||
| 33 | END; | ||
| 34 | FOREACH ROW IN tbody.rows; | ||
| 35 | FOREACH COL IN columns; | ||
| 36 | COL_ID = COL.col_id; | ||
| 37 | IF SKIP_TYPES.grep(COL.type).empty(); | ||
| 38 | UNLESS loop.first(); | ||
| 39 | ' | '; | |
| 40 | END; | ||
| 41 | INCLUDE do_quote VALUE = ROW.$COL_ID; | ||
| 42 | END; | ||
| 43 | END; | ||
| 44 | END; | ||
| 45 | END; | ||
| 46 | PROCESS dynatable tbody = {rows = rows }; | ||
| 47 | ?> |