-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge dynatable sub-template into templates
All the dynatable sub-templates were single-use in the sense that they were included in exactly one top-level template. Simplify template setup *and* customization options for users by merging the sub-templates into their parents.
- Loading branch information
1 parent
c479363
commit 41d74f8
Showing
10 changed files
with
365 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,59 @@ | ||
<?lsmb# This is a comment block; it's ignored by the template engine. | ||
|
||
Version: 1.0 | ||
Date: 2021-01-04 | ||
Version: 1.1 | ||
Date: 2024-08-21 | ||
File: display_report.csv | ||
Set: demo | ||
|
||
Template version numbers are explicitly not aligned across templates or | ||
releases. No explicit versioning was applied before 2021-01-04. | ||
|
||
Version Changes | ||
1.1 Merged 'dynatable.csv' into this template | ||
|
||
|
||
-?> | ||
<?lsmb PROCESS 'dynatable.csv'; | ||
<?lsmb- | ||
|
||
BLOCK do_quote ; | ||
IF VALUE.to_output.defined(); | ||
value = VALUE.to_output(); | ||
ELSE; | ||
value = VALUE; | ||
END; | ||
|
||
IF value.match('[^0-9.+-]'); # any non-digit means run escaping | ||
'"'; value.replace('"', '""'); '"'; # " balance the double quotes | ||
ELSE; | ||
value; | ||
END; | ||
END; | ||
|
||
BLOCK dynatable; | ||
SKIP_TYPES = ['hidden', 'radio', 'checkbox']; | ||
|
||
FOREACH COL IN columns; | ||
IF SKIP_TYPES.grep(COL.type).empty(); | ||
UNLESS loop.first(); | ||
','; | ||
END; | ||
INCLUDE do_quote VALUE = COL.name; | ||
END; | ||
END; | ||
|
||
FOREACH ROW IN tbody.rows; | ||
FOREACH COL IN columns; | ||
COL_ID = COL.col_id; | ||
IF SKIP_TYPES.grep(COL.type).empty(); | ||
UNLESS loop.first(); | ||
','; | ||
END; | ||
INCLUDE do_quote VALUE = ROW.$COL_ID; | ||
END; | ||
END; | ||
END; | ||
END; | ||
|
||
|
||
PROCESS dynatable tbody = {rows = rows }; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.