Cataloguer/layouts/partials/tv/table-body.html
2023-02-17 19:13:50 -05:00

33 lines
1.1 KiB
HTML

{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Date Watched" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort ( sort ( index $.Site.Data.tv ( .Scratch.Get "listMode" ) ) "Episode Title" "asc" ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
<cite class="series">{{ index . "Series Title" }}</cite>
</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "tv" ) "Title" ( index . "Episode Title" ) ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="episode">{{ index . "Episode Title" }}</cite>
<span class="episode-number">({{ index . "Episode Number" }})</span>
{{- with ( where ( where $.Site.Pages "Section" "tv" ) "Title" ( index . "Episode Title" ) ) -}}
</a>
{{- end -}}
</td>
<td>
{{- if ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
{{ end }}