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

86 lines
1.9 KiB
HTML

{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.tv_series.current "date_started" "desc" ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
<td>
{{- with ( index . "name" ) -}}
<cite
class="cite"
itemscope
itemtype="TVSeries"
>{{ . }}</cite
>
{{- end -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "date_finished" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort $.Site.Data.tv_series.log ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
<td>
{{- with ( index . "name" ) -}}
<cite
class="cite"
itemscope
itemtype="TVSeries"
>{{ . }}</cite
>
{{- end -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.tv_series.wishlist "name" "asc" ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
<td>
{{- with ( index . "name" ) -}}
<cite
class="cite"
itemscope
itemtype="TVSeries"
>{{ . }}</cite
>
{{- end -}}
</td>
</tr>
{{ end }}
{{ end }}