Cataloguer/layouts/partials/tv/table-body.html

46 lines
1.8 KiB
HTML

{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "date_finished" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort ( index $.Site.Data.tv_episodes ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
{{- with ( index . "Series Title" ) -}}
<cite class="cite" itemscope itemtype="TVSeries">{{ . }}</cite>
{{- else -}}
{{- $series := partialCached "series_by_id" ( dict "g" $ "tmdb_id" .series.tmdb_id ) .series.tmdb_id -}}
{{- if ( not ( eq $series "" ) ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVSeries" "title" $series.name "titleLang" $series.original_language "titleTrans" $series.original_name ) -}}
{{- else -}}
Unknown series
{{- end -}}
{{- end -}}
</td>
<td>
{{- if ( index . "Episode Title" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVEpisode" "title" ( index . "Episode Title" ) ) -}}
<span class="episode-number">({{ index . "Episode Number" }})</span>
{{- else -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "tv" "schemaType" "TVEpisode" "title" .name ) -}}
<span class="episode-number">(S{{ .season_number }}E{{ .episode_number }})</span>
{{- end -}}
</td>
<td>
{{- if ( or ( index . "Date Watched" ) .date_finished ) -}}
{{- with ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- end -}}
{{- if ( or .is_rewatch .Rewatch ) }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
</td>
</tr>
{{ end }}
{{ end }}