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 / app / templates / detail.tmpl
detail.tmpl 2.6K
1{{/*2 detail — one feature's card.34 The card is an outerMorph region (internal/app/partials.go): a swap replaces5 the element itself, attributes and all, so the element can carry the `hidden`6 the carried assets/css/pin-detail.css keys the results list off — and it7 carries it on every swap, not only on the first paint. A closed card is a8 hidden card, which is the same fact the reference implementation's script set9 by hand after each render; here the server says it, out of the session, and10 there is nothing left to fall out of step with.1112 ONE ROW IS RENDERED EMPTY, and only one: the grid cell. Where a point stands13 is the payload's and is written here; what that place is *called* is the14 analysis lane's, and the server has no access to it. So the row is rendered15 present, empty and hidden for a point, and the seam fills it and un-hides it16 after every swap (render/viewport.ts, writeCell) -- the same division the17 footer's "N of M" sentence is written across. A shape has no point to name,18 so it has no row at all, which is the branch the reference hid.19*/}}20{{define "detail"}}<article id="atlas-detail" class="pin-detail"{{if not .Detail.Open}} hidden{{end}}>{{with .Detail}}{{if .Open}}21 <button type="button" class="detail-back" id="close-detail" aria-label="Back to results"22 hx-post="/session/select" hx-vals:append='{"feature":""}'>23 <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3 5 8l5 5"/></svg>24 Back to results25 </button>26 <div class="detail-category">27 <span id="detail-dot" style="background: {{.Color}}">{{.Glyph}}</span>28 <span id="detail-category">{{.Category}}</span>29 </div>30 <h2 id="detail-title">{{.Title}}</h2>31 <p id="detail-description">{{.Description}}</p>32 <nav class="detail-links" id="detail-links"{{if not .Links}} hidden{{end}}>33 {{range .Links}}<button type="button" class="detail-link" data-location="{{.ID}}"34 hx-post="/session/select" hx-vals:append='{"feature":"{{.ID}}","focus":"1"}'>{{.Title}}</button>35 {{end}}36 </nav>37 <dl>38 <div><dt>ID</dt><dd id="detail-id">{{.ID}}</dd></div>39 <div id="detail-coordinates-field"{{if not .Coordinates}} hidden{{end}}><dt>Coordinates</dt><dd id="detail-coordinates">{{.Coordinates}}</dd></div>40 {{if .Point}}<div id="detail-cell-field" hidden><dt>Grid cell</dt><dd id="detail-cell"></dd></div>41 {{end}}<div id="detail-source-field"{{if not .Source}} hidden{{end}}><dt>Source</dt><dd id="detail-source">{{.Source}}</dd></div>42 {{range .Rows}}<div data-feature-row="{{.Key}}"><dt>{{.Label}}</dt><dd>{{.Value}}</dd></div>43 {{end}}44 </dl>45{{end}}{{end}}</article>46{{end}}