Cataloguer/layouts/partials/films/table-body.html
2022-12-17 12:41:44 -06:00

39 lines
1 KiB
HTML

{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Watched Date" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ else }}
{{ .Scratch.Set "filterCol" "Name" }}
{{ .Scratch.Set "filterDir" "asc" }}
{{ end }}
{{ range ( sort ( sort ( index $.Site.Data.films ( .Scratch.Get "listMode" ) ) "Name" "asc" ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>{{ .Date }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Name ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .Name }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "Title" .Name ) -}}
</a>
{{- end -}}
</td>
<td>{{ .Year }}</td>
<td>
{{- if ( index . "Watched Date" ) -}}
{{- index . "Watched Date" -}}
{{- else -}}
n/a
{{- end -}}
</td>
<td>
{{- if ( index . "Watched Date" ) -}}
{{- if .Rewatch }}&#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}