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

79 lines
2.6 KiB
HTML
Raw Normal View History

2023-01-29 18:44:51 +00:00
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
2023-10-05 18:27:13 +00:00
{{ range ( sort $.Site.Data.games.current "Date Started" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
2023-10-05 18:27:13 +00:00
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
<td>
{{- if index . "Date Started" -}}
2024-12-21 22:23:09 +00:00
Since {{ time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
2023-10-05 18:27:13 +00:00
{{- else -}}
Unknown
2024-12-21 22:23:09 +00:00
{{- end -}}
2023-10-05 18:27:13 +00:00
</td>
</tr>
{{ end }}
2023-01-29 18:44:51 +00:00
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
2023-10-05 18:27:13 +00:00
<tr>
<td colspan=4><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
2023-10-05 18:27:13 +00:00
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</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 -}}
{{- if index . "Level of Completion" }} <span class="games__level-of-completion">({{ index . "Level of Completion" }})</span>{{- end -}}
</td>
</tr>
{{ end }}
<tr>
<td colspan=5><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
2023-10-05 18:27:13 +00:00
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</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 -}}
{{- if index . "Level of Completion" }} <span class="games__level-of-completion">({{ index . "Level of Completion" }})</span>{{- end -}}
</td>
</tr>
{{ end }}
2023-01-29 18:44:51 +00:00
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
2023-10-05 18:27:13 +00:00
{{ range ( sort $.Site.Data.games.wishlist "Title" "asc" ) }}
<tr>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
2023-10-05 18:27:13 +00:00
</td>
<td>{{ index . "Date Released" }}</td>
<td>{{ .Platforms }}</td>
<td>n/a</td>
</tr>
{{ end }}
2022-12-17 18:41:44 +00:00
{{ end }}