feat: add a Tools page printer for note merge and print presets
Chapter officers can merge a markdown note onto filtered students, teams, or events and save the recipe. Extra student-note columns are additional fields (any ## … fields heading) so they work as print tokens whether imported or typed by hand. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Page printer
|
||||
|
||||
**Created:** 2026-08-29
|
||||
**Last updated:** 2026-08-30
|
||||
**Description:** Merge a markdown note onto students, teams, or events and print one page per match. Save the recipe as a print preset.
|
||||
|
||||
## Where to open it
|
||||
|
||||
Sign in and go to **Tools → Page printer** (`/print`).
|
||||
|
||||
## Write a template note
|
||||
|
||||
Create a standalone note on **Notes** (not a page note or student note). Use `{{tokens}}` for values. Click a token chip on the printer page to copy it.
|
||||
|
||||
```markdown
|
||||
# Interview — {{FirstName}} {{LastName}}
|
||||
|
||||
| Grade | Interview Time | Application |
|
||||
| --- | --- | --- |
|
||||
| {{Grade}} | {{Interview Time}} | {{Application}} |
|
||||
|
||||
1. Why did you join TSA?
|
||||
2. What events interest you?
|
||||
```
|
||||
|
||||
Unknown tokens stay visible so typos are obvious. Empty values (including a missing Interview Time) print blank.
|
||||
|
||||
Put `{{PageBreak}}` on its own line to force a new printed sheet **inside** one record (for example, questions on page 1 and a scoring rubric on page 2).
|
||||
|
||||
Put `{{AnswerSpace}}` where you want ruled write-in lines. Markdown collapses blank lines, so extra empty lines in the note will not leave room to write.
|
||||
|
||||
Additional-field tokens use the same names as the Students index columns (for example `{{Interview Time}}`). Those values come from each student's `#Student:{id}` `## Additional fields` table. See [student-notes-import.md](student-notes-import.md).
|
||||
|
||||
## Filters
|
||||
|
||||
Pick **Students**, **Teams**, or **Events**, then optional filters.
|
||||
|
||||
For students: Grade, TSA year, and officer (any / officers only / non-officers). Example: TSA year `1` prints first-year students. `{{OfficerRole}}` still prints the office name when they have one. Additional fields such as Interview Time are merge tokens, not filters. Student pages sort by last name, then first name.
|
||||
|
||||
## Print presets
|
||||
|
||||
A print preset stores the *recipe* only: name, template note, entity type, and filters. It does not store merged pages. Each Preview uses the current roster and notes.
|
||||
|
||||
1. Set the note, entity, and filters.
|
||||
2. Enter a name and click **Save as**.
|
||||
3. Later, choose a preset, click **Preview**, then **Print**.
|
||||
4. **Update** overwrites the selected preset. **Delete** removes it.
|
||||
|
||||
If the template note was removed, the filters still load. Choose another note before Preview.
|
||||
|
||||
## Print
|
||||
|
||||
**Preview** builds the pages. **Print** opens the browser print dialog (same as other handouts). Navigation is hidden.
|
||||
|
||||
**New page per record** (on by default, saved with the preset) starts each match on a new sheet. Turn it off to flow records together; `{{PageBreak}}` in the template still works. Content that is taller than one sheet continues naturally.
|
||||
|
||||
**Font size (pt)** (default 12) and **Answer lines** (default 3) apply to every page-printer recipe. They are saved on the preset.
|
||||
|
||||
If Preview finds more than 75 matches, a warning is shown first.
|
||||
@@ -1,7 +1,7 @@
|
||||
# Import Students and Note Fields
|
||||
|
||||
**Created:** 2026-08-29
|
||||
**Last updated:** 2026-08-29
|
||||
**Last updated:** 2026-08-30
|
||||
|
||||
**Description:** How `/students/import` creates students and merges leftover CSV columns into each student's markdown notes.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
Each student has a system note titled `#Student:{id}`. It is edited on the student edit page and shown on student details. Those notes are hidden from the main Notes list.
|
||||
|
||||
Imported leftover values go in a table under `## Imported fields`. Other markdown above or below that heading is left alone.
|
||||
Leftover CSV values (and any fields you add by hand) go in a table under `## Additional fields`. Any `## … fields` heading is read the same way (for example an older `## Imported fields`). Other markdown above or below that heading is left alone.
|
||||
|
||||
## CSV format
|
||||
|
||||
@@ -39,7 +39,7 @@ A notes-only file without `Grade` will not import. Put roster and leftover colum
|
||||
|
||||
1. Sign in as an Administrator.
|
||||
2. Open **Students** and click **Import**, or go to `/students/import`.
|
||||
The arrow next to **Import** downloads a CSV template (roster columns, Students index columns, and any other imported fields already in notes).
|
||||
The arrow next to **Import** downloads a CSV template (roster columns, Students index columns, and any other additional fields already in notes).
|
||||
`/import` still opens this same student page.
|
||||
3. Upload the student CSV.
|
||||
4. Review new vs existing counts and leftover field names.
|
||||
@@ -47,4 +47,4 @@ A notes-only file without `Grade` will not import. Put roster and leftover colum
|
||||
|
||||
## Index columns
|
||||
|
||||
Chapter Settings → **Student Index Columns** lists which imported field names appear as extra columns on the Students index. The page also shows field names already present in student notes; click a chip to add or remove it from the list. Open Students again after saving; a restart is not required.
|
||||
Chapter Settings → **Student Index Columns** lists which additional field names appear as extra columns on the Students index. The page also shows field names already present in student notes; click a chip to add or remove it from the list. Open Students again after saving; a restart is not required.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Page printer plan
|
||||
|
||||
**Created:** 2026-08-29
|
||||
**Last updated:** 2026-08-30
|
||||
**Description:** Implementation notes for the Tools page printer (markdown note merge + print presets).
|
||||
|
||||
User-facing steps: [docs/instructions/page-printer.md](../instructions/page-printer.md).
|
||||
|
||||
## Built
|
||||
|
||||
- Core merge: `{{tokens}}`, `{{PageBreak}}`, `{{AnswerSpace}}`, print presets JSON
|
||||
- `/print` UI: entity filters, font size, answer-space lines, Preview/Print, save/load/update/delete presets
|
||||
- Student pages sort by last name, then first name
|
||||
- EF migration `AddPrintPresets` (applied on next app start)
|
||||
Reference in New Issue
Block a user