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

47 lines
1.8 KiB
HTML
Raw Permalink Normal View History

2023-02-17 20:22:09 +00:00
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "date_finished" }}
2023-02-17 20:22:09 +00:00
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort ( index $.Site.Data.tv_episodes ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
2023-02-17 20:22:09 +00:00
<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 -}}
2023-02-17 20:22:09 +00:00
</td>
2023-02-17 20:22:09 +00:00
<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 -}}
2023-02-17 20:22:09 +00:00
</td>
2023-02-17 20:22:09 +00:00
<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 -}}
2023-02-17 20:22:09 +00:00
</td>
</tr>
{{ end }}
{{ end }}