Files
yann64andClaude Opus 5.5 dfb2d2ce68 Tables with a header row can be sorted by clicking a column header
Listing tables on company, taxonomy and generic list pages get column headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
2026-10-12 21:03:41 +02:00

30 lines
1.2 KiB
HTML

{{/* table of pages: machines get company/year/type columns; companies are a plain list.
Takes the pages, or (dict "pages" … "head" true) to add the column headers (sortable). */}}
{{ $pages := . }}{{ $head := false }}
{{ if reflect.IsMap . }}{{ $pages = .pages }}{{ $head = .head }}{{ end }}
{{ if eq (index $pages 0).Section "companies" }}
<ul class="columns">
{{ range $pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> <small>({{ len .Params.machines }})</small></li>
{{ end }}
</ul>
{{ else }}
<table class="list">
{{ if $head }}
<thead>
<tr><th>Name</th><th>Year</th><th>{{ if eq (index $pages 0).Section "software" }}Tags{{ else }}Type{{ end }}</th><th>Origin</th></tr>
</thead>
{{ end }}
<tbody>
{{ range $pages }}
<tr>
<td><a href="{{ .RelPermalink }}">{{ .Title }}</a></td>
<td>{{ partial "terms.html" (dict "page" . "taxonomy" "years") }}</td>
<td>{{ partial "terms.html" (dict "page" . "taxonomy" "types") }}{{ partial "terms.html" (dict "page" . "taxonomy" "tags") }}{{ partial "terms.html" (dict "page" . "taxonomy" "topics") }}</td>
<td>{{ partial "terms.html" (dict "page" . "taxonomy" "origins") }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}