add stats, make work with new key names, etc.

This commit is contained in:
Ben Goldsworthy 2024-07-23 09:57:11 +02:00
parent 4f55dc1884
commit 78d829e1ac
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE
18 changed files with 312 additions and 151 deletions

View file

@ -3,8 +3,8 @@ $dark: #020202;
$light: #fffff0;
// Fonts
$defaultFont: "Palatino Linotype", "Book Antiqua", Palatino, serif;
$codeFont: "Input Mono", "Lucida Console", Monaco, monospace;
$defaultFont: "Domitian", "Palatino Linotype", "Book Antiqua", Palatino, serif;
$codeFont: /*"Input Mono", */"Lucida Console", Monaco, monospace;
// Breakpoints
$breakpoints: (

View file

@ -216,11 +216,22 @@ cite,
}
}
table .cite {
font-style: normal;
}
.episode-number,
.authors--addtional,
.authors--additional,
.comments,
.edition,
.year--original {
font-size: 0.75em;
opacity: 0.8;
}
.comments,
.edition {
margin-block-start: 0.4em;
margin-block-end: 0;
}
code,
@ -306,7 +317,12 @@ kbd {
* Special Text
*/
:where([title]) {
text-decoration: underline;
text-decoration: underline dotted;
&:not(a *) {
cursor: help;
}
}

View file

@ -0,0 +1,18 @@
.log-stats {
text-align: center;
font-size: 1.4em;
& summary {
cursor: pointer;
}
& div {
display: flex;
justify-content: center;
& p {
float: left;
margin-inline-end: 1.2em;
}
}
}

View file

@ -57,6 +57,7 @@
@import "components/icons";
@import "components/item-tile";
@import "components/table";
@import "components/log-stats";
@import "pages/home";
@import "pages/collection";

View file

@ -9,7 +9,8 @@
{{ define "main-header" }}
<header class="site-content__header">
{{ $section := first 1 ( split .File.Dir "/" ) }}
{{- .Scratch.Set "section" ( first 1 ( split .File.Dir "/" ) ) -}}
{{- $section := .Scratch.Get "section" -}}
{{ if ( or ( in "books" ( delimit $section "" ) ) ( in "games" ( delimit $section "" ) ) ) }}
<a href="/{{ delimit $section "" }}/current">Current</a> ~
{{ end }}
@ -28,18 +29,27 @@
{{ end }}
{{ define "main-body" }}
<main class="site-content__body">
<main class="site-content__body">
{{ if .File }}
{{ .Scratch.Set "page" ( index ( split .File.Dir "/" ) 1 ) }}
{{ if ( in "current log wishlist" ( .Scratch.Get "page" ) ) }}
{{ if ( eq ( .Scratch.Get "page" ) "current" ) }}
{{ .Scratch.Set "listMode" "current" }}
{{ else if ( eq ( .Scratch.Get "page" ) "log" ) }}
{{ .Scratch.Set "listMode" "log" }}
{{ else if ( eq ( .Scratch.Get "page" ) "wishlist" ) }}
{{ .Scratch.Set "listMode" "wishlist" }}
{{ end }}
{{ partial "stats" . }}
{{ partial "table" . }}
{{ end }}
{{ end }}
</main>

View file

@ -1,7 +0,0 @@
<p class="year">{{- index . "Year Published" -}}
{{- if ( index . "Original Publication Year" ) -}}
{{- if ( ne ( index . "Original Publication Year" ) ( index . "Year Published" ) ) -}}
&nbsp;<span class="year--original">(<abbr title="original publication year">orig.</abbr>&nbsp;{{ index . "Original Publication Year" }})</span>
{{- end -}}
{{- end -}}
</p>

View file

@ -0,0 +1,34 @@
{{- with .Author -}}
<p class="authors">{{ . }}</p>
{{- else -}}
{{- $authors_names := slice -}}
{{- range .authors -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- range .work.authors -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- if .contributors -}}
{{- range ( where .contributors "role" "like" `[aA]uthor` ) -}}
{{- $authors_names = $authors_names | append .name -}}
{{- end -}}
{{- end -}}
<p class="authors">{{ delimit ( uniq $authors_names ) ", " }}</p>
{{- end -}}
{{- if .contributors -}}
{{- $translators_names := slice -}}
{{- range ( where .contributors "role" "like" `[tT]ranslat` ) -}}
{{- $translators_names = $translators_names | append .name -}}
{{- end -}}
{{- with $translators_names -}}
<p class="authors--additional">Translator(s): {{ delimit ( uniq . ) ", " }}</p>
{{- end -}}
{{- end -}}
{{- with ( index . "Additional Authors" ) -}}
<p class="authors--additional">Additional Author(s): {{ . }}</p>
{{- end -}}

View file

@ -0,0 +1,7 @@
<p class="year">{{- .publish_date -}}
{{- if .first_publish_date -}}
{{- if ( ne .first_publish_date .publish_date ) -}}
&nbsp;<span class="year--original">(<abbr title="original publication year">orig.</abbr>&nbsp;{{ .first_publish_date }})</span>
{{- end -}}
{{- end -}}
</p>

View file

@ -0,0 +1,9 @@
{{- with .date_started -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
Unknown
{{- end -}}&ndash;{{- with .date_finished -}}
{{- time.Format "Jan 2, 2006" . -}}
{{- else -}}
Unknown
{{- end -}}

View file

@ -0,0 +1,23 @@
{{-
$cite_options := ( dict
"c" .c
"g" .g
"section" "books"
"schemaType" "Book"
"title" ( cond ( isset .c "subtitle" ) (
printf "%s: %s" .c.title .c.subtitle
) (
.c.title
)
)
"edition" (
default .c.edition_name .c.Edition
)
)
-}}
{{- if .c.work.original_language -}}
{{- $cite_options = merge $cite_options ( dict "titleLang" .c.work.original_language "titleTrans" .c.work.title ) -}}
{{- end -}}
{{- partial "cite" $cite_options -}}

View file

@ -1,23 +1,26 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.books.current "Date Started" "desc" ) }}
{{ range ( sort $.Site.Data.books.current "date_started" "desc" ) }}
<tr>
<td>{{ if index . "Date Added" }}{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}{{ else }}n/a{{end }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "Book" ) -}}
</td>
<td>
<p class="author">{{ .Author }}</p>
{{- if ( index . "Additional Authors" ) -}}
<p class="author--additional">Additional: {{ index . "Additional Authors" }}</p>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/publication-year.html" . -}}
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- if index . "Date Started" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- end -}}&ndash;
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
@ -27,39 +30,26 @@
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>{{ if index . "Date Added" }}{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}{{ else }}n/a{{end }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
<p>
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="book">{{ .Title }}</cite>{{ if .Edition }} <span class="book--edition">({{ .Edition }})</span>{{ end }}
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
</a>
{{- end -}}
</p>
</td>
<td>
<p class="author">{{ .Author }}</p>
{{- if ( index . "Additional Authors" ) -}}
<p class="author--additional">Additional: {{ index . "Additional Authors" }}</p>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/publication-year.html" . -}}
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- if index . "Date Started" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
Unknown
{{- end -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- else -}}
Unknown
{{- end -}}
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
@ -68,68 +58,50 @@
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>{{ if index . "Date Added" }}{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}{{ else }}n/a{{end }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
<p>
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="book">{{ .Title }}</cite>{{ if .Edition }} <span class="book--edition">({{ .Edition }})</span>{{ end }}
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
</a>
{{- end -}}
</p>
</td>
<td>
<p class="author">{{ .Author }}</p>
{{- if ( index . "Additional Authors" ) -}}
<p class="author--additional">Additional: {{ index . "Additional Authors" }}</p>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/publication-year.html" . -}}
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- if index . "Date Started" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
Unknown
{{- end -}}&ndash;{{- if index . "Date Finished" -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Finished" ) -}}
{{- else -}}
Unknown
{{- end -}}
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.books.wishlist "Title" "asc" ) }}
<tr>
<td>{{ if index . "Date Added" }}{{ time.Format "Jan 2, 2006" ( index . "Date Added" ) }}{{ else }}n/a{{end }}</td>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
<td>
<p>
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="book">{{ .Title }}</cite>{{ if .Edition }} <span class="book--edition">({{ .Edition }})</span>{{ end }}
{{- with ( where ( where $.Site.Pages "Section" "books" ) "Title" .Title ) -}}
</a>
{{- end -}}
</p>
</td>
<td>
<p class="author">{{ .Author }}</p>
{{- if ( index . "Additional Authors" ) -}}
<p class="author--additional">Additional: {{ index . "Additional Authors" }}</p>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/publication-year.html" . -}}
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>n/a</td>
</tr>
{{ end }}

View file

@ -1,16 +1,21 @@
{{- $itemType := default "CreativeWork" .schemaType -}}
{{- $pages := where ( where .g.Site.Pages "Section" .section ) "title" .title | first 1 -}}
{{- with .c -}}
<cite
class="cite{{ with .CiteStyle }} cite--{{ . }}{{ end }}"
itemscope
itemprop="citation"
itemtype="https://schema.org/{{- $itemType -}}"
{{- if .TitleLang -}}
lang="{{- .TitleLang -}}"
title="{{- .TitleTrans -}}"
{{- end -}}>
{{- default .Title $.title -}}
</cite>
{{- if .Edition }} <span class="edition">({{ .Edition }})</span>{{- end -}}
{{- with $pages -}}{{- range . -}}<a href="{{ .RelPermalink }}">{{- end -}}{{- end -}}
<cite
class="cite{{ with .citeStyle }} cite--{{ . }}{{ end }}"
itemscope
itemprop="citation"
itemtype="https://schema.org/{{- $itemType -}}"
{{- if $.titleTrans -}}
lang="{{- $.titleLang -}}"
title="{{- $.titleTrans -}}"
{{- end -}}>
{{- default .Title $.title -}}
</cite>
{{- with $pages -}}</a>{{- end -}}
{{- with $.edition }}<p class="edition">{{ . }}</p>{{- end -}}
{{- end -}}

View file

@ -2,16 +2,23 @@
<tr>
<td colspan=4><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "date_completed" "!=" "" ) "date_completed" "desc" ) }}
{{ range ( sort ( where $.Site.Data.films.log "date_finished" "!=" "" ) "date_finished" "desc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{ .title }}
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_completed -}}
{{- time.Format "Jan 2, 2006" .date_completed -}}
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a
@ -22,24 +29,23 @@
<tr>
<td colspan=4><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.films.log "date_completed" "" ) "title" "asc" ) }}
{{ range ( sort ( where $.Site.Data.films.log "date_finished" "" ) "title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
</a>
{{- end -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_completed -}}
{{- time.Format "Jan 2, 2006" .date_completed -}}
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a
@ -51,21 +57,20 @@
{{ range ( sort $.Site.Data.films.wishlist "title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
{{ range . }}
<a href="{{ .RelPermalink }}">
{{ end }}
{{- end -}}
<cite class="film">{{ .title }}</cite>
{{- with ( where ( where $.Site.Pages "Section" "films" ) "title" .title ) -}}
</a>
{{- partial "cite" ( dict "c" . "g" $ "section" "films" "schemaType" "Movie" "title" .title "titleLang" .original_language "titleTrans" .original_title ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>{{ with .release_date }}{{ time.Format "Jan 2, 2006" . }}{{ end }}</td>
<td>
{{- if .date_completed -}}
{{- time.Format "Jan 2, 2006" .date_completed -}}
{{- if .date_finished -}}
{{- time.Format "Jan 2, 2006" .date_finished -}}
{{- if .is_repeat }} &#x21BB;{{ end -}}
{{- else -}}
n/a

View file

@ -1,4 +1,4 @@
<th>Date Added</th>
<th>Title</th>
<th>Release Year</th>
<th>Release Date</th>
<th>Date Watched</th>

View file

@ -2,7 +2,7 @@
{{ range ( sort $.Site.Data.games.current "Date Started" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "VideoGame" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
@ -22,7 +22,7 @@
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "VideoGame" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
@ -46,7 +46,7 @@
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "VideoGame" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
@ -68,7 +68,7 @@
{{ range ( sort $.Site.Data.games.wishlist "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "VideoGame" ) -}}
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>

View file

@ -0,0 +1,22 @@
{{- $series_tmdb_id := .tmdb_id -}}
{{- $series := "" -}}
{{- range ( index .g.Site.Data.tv_series.current ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- range ( index .g.Site.Data.tv_series.log ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- range ( index .g.Site.Data.tv_series.wishlist ) -}}
{{- if ( eq .tmdb_id $series_tmdb_id ) -}}
{{- $series = . -}}
{{- end -}}
{{- end -}}
{{- return $series -}}

View file

@ -0,0 +1,26 @@
{{- $section := default "" ( .Scratch.Get "section" ) -}}
{{- $list_mode := default "" ( .Scratch.Get "listMode" ) -}}
{{- $log_file := index ( index $.Site.Data $section ) $list_mode -}}
{{- if $log_file -}}
{{- $total := len $log_file -}}
{{- $today := time.Now -}}
{{- $this_year_total := len ( where ( where $log_file "date_finished" "gt" ( ( $today.AddDate -1 0 0 ).Format "2006-01-02" ) ) "date_finished" "lt" "2024-12-31" ) -}}
{{- $this_quarter_total := len ( where ( where $log_file "date_finished" "gt" ( ( $today.AddDate 0 -3 0 ).Format "2006-01-02" ) ) "date_finished" "lt" "2024-09-30" ) -}}
{{- $this_month_total := len ( where ( where $log_file "date_finished" "gt" ( ( $today.AddDate 0 -1 0 ).Format "2006-01-02" ) ) "date_finished" "lt" "2024-07-31" ) -}}
<details class="log-stats">
<summary>Summary</summary>
<div>
<p>Total: {{ $total }}</p>
{{- if eq $list_mode "log" -}}
<p>Last 12 months: {{ $this_year_total }}</p>
<p>Last 3 months: {{ $this_quarter_total }}</p>
<p>Last month: {{ $this_month_total }}</p>
{{- end -}}
</div>
</details>
{{- end -}}

View file

@ -1,25 +1,45 @@
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
{{ .Scratch.Set "filterCol" "Date Watched" }}
{{ .Scratch.Set "filterCol" "date_finished" }}
{{ .Scratch.Set "filterDir" "desc" }}
{{ end }}
{{ range ( sort ( index $.Site.Data.tv ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
{{ range ( sort ( index $.Site.Data.tv_episodes ( .Scratch.Get "listMode" ) ) ( .Scratch.Get "filterCol" ) ( .Scratch.Get "filterDir" ) ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "schemaType" "TVSeries" "title" ( index . "Series Title" ) ) -}}
{{- 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>
{{- partial "cite" ( dict "c" . "schemaType" "TVEpisode" "title" ( index . "Episode Title" ) ) -}}
<span class="episode-number">({{ index . "Episode Number" }})</span>
{{- 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 ( index . "Date Watched" ) -}}
{{- time.Format "Jan 2, 2006" ( index . "Date Watched" ) -}}
{{- if .Rewatch }} &#x21BB;{{ end -}}
{{- else -}}
n/a
{{- end -}}
{{- 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 }}