59fe69d35d
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
89 lines
4.1 KiB
HTML
89 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Abenteuerblatt - {{.Character.Name}}</title>
|
|
<link rel="stylesheet" href="shared/export_format_a4_quer.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<span class="header-left">Abenteuerblatt</span>
|
|
<span class="header-right">Datum: {{.Meta.Date}}</span>
|
|
</div>
|
|
<div class="title-row">
|
|
<img src="shared/images/headerimg.png" alt="Schmuckgrafik" class="header-decoration">
|
|
<div class="info-box">
|
|
<div><strong>Figur</strong> {{.Character.Name}} <strong>Grad</strong> {{.Character.Grade}}</div>
|
|
<hr>
|
|
<div><strong>Typ</strong> {{.Character.Type}} <strong>GG</strong> {{.DerivedValues.GG}} <strong>SG</strong> {{.DerivedValues.SG}}</div>
|
|
</div>
|
|
<img src="shared/images/headerimg.png" alt="Schmuckgrafik" class="header-decoration">
|
|
</div>
|
|
<div class="flex main-content">
|
|
<!-- Left section -->
|
|
<div class="left-section">
|
|
<!-- Skills tables -->
|
|
<div class="skills-row">
|
|
<!-- BLOCK: skills_learned, TYPE: skills, MAX: 7, FILTER: learned -->
|
|
<table class="skills-table">
|
|
<tr>
|
|
<th>Fertigkeit</th>
|
|
<th>EW</th>
|
|
<th>PP</th>
|
|
</tr>
|
|
{{range .SkillsLearned}}
|
|
<tr><td>{{.Name}}</td><td>{{if .Value}}+ {{.Value}}{{else}} {{end}}</td><td>{{if .PracticePoints}}{{.PracticePoints}}{{end}}</td></tr>
|
|
{{end}}
|
|
</table>
|
|
<!-- BLOCK: skills_languages, TYPE: skills, MAX: 4, FILTER: language -->
|
|
<table class="skills-table" style="width: 100%; height: unset;">
|
|
<tr>
|
|
<th>Fertigkeit</th>
|
|
<th>EW</th>
|
|
<th>PP</th>
|
|
</tr>
|
|
{{range .SkillsLanguage}}
|
|
<tr><td>{{.Name}}</td><td>{{if .Value}}+ {{.Value}}{{else}} {{end}}</td><td>{{if .PracticePoints}}{{.PracticePoints}}{{end}}</td></tr>
|
|
{{end}}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- Right section -->
|
|
<div class="right-section">
|
|
<!-- Weapons table -->
|
|
<div class="margin-bottom-3">
|
|
<!-- BLOCK: weapons_main, TYPE: weapons, MAX: 3 -->
|
|
<table class="weapons-table">
|
|
<tr>
|
|
<th>Waffe</th>
|
|
<th>Fert.<br>wert</th>
|
|
<th>Schaden</th>
|
|
<th>Reichweite<br/>nah/mitte/fern</th>
|
|
</tr>
|
|
{{range .Weapons}}
|
|
<tr>
|
|
<td>{{.Name}}</td>
|
|
<td>{{if .Value}}{{.Value}}{{else}} {{end}}</td>
|
|
<td>{{if .Damage}}{{.Damage}}{{else}} {{end}}</td>
|
|
<td>{{if .Range}}{{.Range}}{{else}} {{end}}</td>
|
|
</tr>
|
|
{{end}}
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Senses row at bottom -->
|
|
<div class="senses-row">
|
|
<span><b>Sehen</b> +{{.DerivedValues.Sehen}}</span>
|
|
<span><b>Nachtsicht</b> +{{.DerivedValues.Sehen}}</span>
|
|
<span><b>Hören</b> +{{.DerivedValues.Horen}}</span>
|
|
<span><b>Riechen/Schmecken</b> +{{.DerivedValues.Riechen}}</span>
|
|
<span><b>Sechster Sinn</b> +{{.DerivedValues.Sechster}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|