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

140 lines
3 KiB
HTML
Raw Normal View History

2025-01-04 20:19:12 +00:00
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.books.current "date_started" "desc" ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
2025-01-04 20:19:12 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- with .date_started -}}
Since
{{ time.Format "Jan 2, 2006" . -}}
2025-01-04 20:19:12 +00:00
{{- else -}}
Unknown
2025-01-04 20:19:12 +00:00
{{- end -}}
</td>
</tr>
{{ end }}
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
<tr>
<td colspan="5"><h3>Diary</h3></td>
2025-01-04 20:19:12 +00:00
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "!=" "" ) "Date Finished" "desc" ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
2025-01-04 20:19:12 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
<td>
{{- partial "books/rows/read-dates.html" . -}}
</td>
</tr>
{{ end }}
<tr>
<td colspan="5"><h3>Assorted</h3></td>
2025-01-04 20:19:12 +00:00
</tr>
{{ range ( sort ( where $.Site.Data.books.log "Date Finished" "" ) "Title" "asc" ) }}
<tr>
<td>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
2025-01-04 20:19:12 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- 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>
{{ with .date_added }}
{{ time.Format "Jan 2, 2006" . }}
{{ else }}
n/a
{{ end }}
</td>
2025-01-04 20:19:12 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
</td>
<td>
{{- partial "books/rows/authors.html" . -}}
</td>
<td>
{{- partial "books/rows/publish-date.html" . -}}
</td>
</tr>
{{ end }}
{{ end }}