clone

an offline map explorer where each world, from a game map to a city's open data, ships as one .atlas file

main
atlas / internal / workbench / templates / diff.tmpl
diff.tmpl 3.7K
1{{/*2 diff — two builds of one volume, read in the A-to-B direction.34 The headline is the score delta and the verdict it earns; the axes, the5 features and the ledgers' agreements are under it as diagnostics. An6 addition is something B has that A did not.7*/}}8{{define "title"}}{{.Volume.Title}} · what moved{{end}}9{{define "content"}}10<section class="page-head">11 <h1>{{.Volume.Title}} <span class="dim">what moved</span></h1>12 <p class="dim"><a href="/volume/{{.Volume.Slug}}">{{.Volume.Slug}}</a> ·13 {{.Diff.A.File}} → {{.Diff.B.File}}</p>14</section>1516<section class="headline">17 <p class="score-big {{if gt .Diff.Movement.Delta 0}}delta-up{{else if lt .Diff.Movement.Delta 0}}delta-down{{else}}delta-flat{{end}}">18 {{.Diff.Delta}}<span class="dim"> points · {{.Diff.Verdict}}</span></p>19 <p class="dim">{{.Diff.Movement.Before}} → {{.Diff.Movement.After}}20 {{if not .Diff.Movement.Comparable}} · scored under different point tables, so nothing is concluded{{end}}21 {{if .Diff.Movement.Allowance}} · the ledger accounts for {{.Diff.Movement.Allowance}} points of decline{{end}}</p>22 {{range .Diff.Movement.Reasons}}<p class="dim">correction: {{.}}</p>{{end}}23</section>2425<section class="card">26 <h2>Score by world</h2>27 <table>28 <thead><tr><th>world</th><th class="num">{{short .Diff.A.Stamp}}</th><th class="num">{{short .Diff.B.Stamp}}</th><th class="num">Δ</th></tr></thead>29 <tbody>30 {{range .Diff.Worlds}}31 <tr><td>{{.Name}}</td><td class="num">{{.A}}</td><td class="num">{{.B}}</td>32 <td class="num {{if gt .Sign 0}}delta-up{{else if lt .Sign 0}}delta-down{{else}}delta-flat{{end}}">{{.Delta}}</td></tr>33 {{end}}34 </tbody>35 </table>36</section>3738<section class="card">39 <h2>Axes <span class="dim">diagnostics</span></h2>40 <table>41 <thead><tr><th>measure</th><th class="num">{{short .Diff.A.Stamp}}</th><th class="num">{{short .Diff.B.Stamp}}</th><th class="num">Δ</th></tr></thead>42 <tbody>43 {{range .Diff.Axes}}44 <tr><td>{{.Name}}</td><td class="num">{{.A}}</td><td class="num">{{.B}}</td>45 <td class="num {{if gt .Sign 0}}delta-up{{else if lt .Sign 0}}delta-down{{else}}delta-flat{{end}}">{{.Delta}}</td></tr>46 {{end}}47 </tbody>48 </table>49</section>5051<div class="columns">52<section class="card">53 <h2>Features added <span class="dim">{{len .Diff.Added}}</span></h2>54 {{if .Diff.Added}}55 <table>56 <thead><tr><th>world</th><th class="num">id</th><th>title</th></tr></thead>57 <tbody>{{range .Diff.Added}}<tr><td>{{.World}}</td><td class="num">{{.ID}}</td><td>{{.Title}}</td></tr>{{end}}</tbody>58 </table>59 {{else}}<p class="dim">None.</p>{{end}}60</section>61<section class="card">62 <h2>Features removed <span class="dim">{{len .Diff.Removed}}</span></h2>63 {{if .Diff.Removed}}64 <table>65 <thead><tr><th>world</th><th class="num">id</th><th>title</th></tr></thead>66 <tbody>{{range .Diff.Removed}}<tr><td>{{.World}}</td><td class="num">{{.ID}}</td><td>{{.Title}}</td></tr>{{end}}</tbody>67 </table>68 {{else}}<p class="dim">None.</p>{{end}}69</section>70</div>7172<section class="card">73 <h2>Matched-pair stability</h2>74 {{if .Diff.Pairs}}75 <p class="dim">A pair is the same pair only when donor and winner both agree; a match that changed winners76 reads as one lost and one gained.</p>77 <table>78 <thead><tr><th>world</th><th>reading</th><th class="num">kept</th><th class="num">gained</th><th class="num">lost</th></tr></thead>79 <tbody>80 {{range .Diff.Pairs}}81 <tr><td>{{.World}}</td><td>{{.Source}}</td><td class="num">{{.Kept}}</td>82 <td class="num">{{.Gained}}</td><td class="num">{{.Lost}}</td></tr>83 {{end}}84 </tbody>85 </table>86 {{else}}<p class="dim">Neither build carries a ledger.</p>{{end}}87</section>88{{end}}