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

90 lines
2.7 KiB
HTML

{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.games.current "Date Started" "desc" ) }}
<tr>
<td>TODO</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ .Platforms }}</td>
<td>{{ index . "Date Released" }}</td>
<td>
{{- if index . "Date Started" -}}
Since
{{ time.Format "Jan 2, 2006" ( index . "Date Started" ) -}}
{{- else -}}
Unknown
{{- end -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
<tr>
<td colspan="6"><h3>Diary</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>TODO</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ .Platforms }}</td>
<td>{{ index . "Date Released" }}</td>
<td>
{{- with index . "Level of Completion" }}
{{ . }}
{{- end -}}
</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 -}}
</td>
</tr>
{{ end }}
<tr>
<td colspan="6"><h3>Assorted</h3></td>
</tr>
{{ range ( sort ( where $.Site.Data.games.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>TODO</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ .Platforms }}</td>
<td>{{ index . "Date Released" }}</td>
<td>
{{- with index . "Level of Completion" }}
{{ . }}
{{- end -}}
</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 -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
{{ range ( sort $.Site.Data.games.wishlist "Title" "asc" ) }}
<tr>
<td>TODO</td>
<td>
{{- partial "cite" ( dict "c" . "g" $ "section" "games" "schemaType" "VideoGame" ) -}}
</td>
<td>{{ .Platforms }}</td>
<td>{{ index . "Date Released" }}</td>
</tr>
{{ end }}
{{ end }}