Commit Graph

12 Commits

Author SHA1 Message Date
Frank 59fe69d35d refactor: Unify PDF pagination system and rename templates
BREAKING CHANGE: Template names changed from page1_stats.html to page_1.html

## Phase 1: Unified Pagination Function
- Implemented PaginateMultiList() to replace PaginateSkills(), PaginateSpells(), and PaginatePage2PlayLists()
- Single metadata-driven function handles all list types (skills, weapons, spells, equipment)
- Properly handles filters (learned/unlearned/language) via template metadata
- Shares list trackers by ListType+Filter combination to avoid duplication
- Added comprehensive tests for all edge cases

## Phase 2: Template Naming Convention
- Renamed templates to be data-agnostic:
  - page1_stats.html -> page_1.html
  - page1.2_stats.html -> page_1.2.html
  - page2_play.html -> page_2.html
  - page2.2_play.html -> page_2.2.html
  - page3_spell.html -> page_3.html
  - page3.2_spell.html -> page_3.2.html
  - page4_equip.html -> page_4.html
- Updated GenerateContinuationTemplateName() for new naming (page_1.html -> page_1.2.html)
- Updated ExtractBaseTemplateName() to handle new format
- Updated all test files and source files with new template names

## Phase 3: Simplified RenderPageWithContinuations
- Removed hardcoded switch statements based on template names
- Replaced with generic dataMap and unified pagination call
- Extracted populatePageDataFromDistribution() to handle data mapping
- Template type detection now driven by metadata, not hardcoded names

## Benefits
-  Extensibility: Add new templates without code changes
-  Maintainability: One pagination algorithm instead of three
-  Clarity: Template names reflect page numbers, not content types
-  Flexibility: Templates can mix any data types
-  All 40+ tests passing

## Technical Details
- Added SkillsColumn3 and SkillsColumn4 fields to PageData for continuation pages
- Template metadata loaded from HTML comments drives pagination behavior
- Backward compatibility maintained for old template references in comments
2025-12-21 22:07:46 +01:00
Frank cd0f98042d PDF generation and downloads are working 2025-12-21 09:15:08 +01:00
Frank 2af477397e added more file type specific instructions
I hope that coding results will be better and more consistent
2025-12-21 08:39:29 +01:00
Frank c3d6af29e7 Frontend PDF Export eingebaut 2025-12-20 18:39:36 +01:00
Frank 915352c0f3 routes and handlker for PDFexport created 2025-12-20 18:32:48 +01:00
Frank 58692f54d6 continuation of lists on a continuation page
pre production ready
2025-12-20 15:03:55 +01:00
Frank 4b9782c290 nur noch ein todo 2025-12-20 00:23:42 +01:00
Frank de6c8c1c1b weapons are displayed fine 2025-12-20 00:19:20 +01:00
Frank 92f9e4c27b Defining list length in Template
Test don't care about list lenght
2025-12-19 22:32:43 +01:00
Frank f6f0b334c2 Updated Got to 1.25.5
made spells display correct spell information
2025-12-19 17:04:20 +01:00
Frank 59755c4516 Defining list length in Template seems to work now 2025-12-19 10:47:05 +01:00
Frank da91eb5f56 fix pagination 2025-12-19 08:24:32 +01:00