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

109 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2023-01-29 18:44:51 +00:00
{{ if ( eq ( .Scratch.Get "listMode" ) "current" ) }}
{{ range ( sort $.Site.Data.books.current "date_started" "desc" ) }}
2023-03-01 03:19:50 +00:00
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
{{- end -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/authors.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/publish-date.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/read-dates.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-10-05 18:27:13 +00:00
</tr>
2023-03-01 03:19:50 +00:00
{{ end }}
2023-01-29 18:44:51 +00:00
{{ else if ( eq ( .Scratch.Get "listMode" ) "log" ) }}
2023-03-01 03:19:50 +00:00
<tr>
<td colspan=5><h3>Diary</h3></td>
</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>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
2023-03-01 03:19:50 +00:00
{{- end -}}
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/authors.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/publish-date.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/read-dates.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-10-05 18:27:13 +00:00
</tr>
2023-03-01 03:19:50 +00:00
{{ end }}
<tr>
<td colspan=5><h3>Assorted</h3></td>
</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>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
2023-03-01 03:19:50 +00:00
{{- end -}}
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/authors.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/publish-date.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/read-dates.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-10-05 18:27:13 +00:00
</tr>
2023-03-01 03:19:50 +00:00
{{ end }}
2023-01-29 18:44:51 +00:00
{{ else if ( eq ( .Scratch.Get "listMode" ) "wishlist" ) }}
2023-03-01 03:19:50 +00:00
{{ range ( sort $.Site.Data.books.wishlist "Title" "asc" ) }}
<tr>
<td>{{ with .date_added }}{{ time.Format "Jan 2, 2006" . }}{{ else }}n/a{{ end }}</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/title.html" ( dict "c" . "g" $ ) -}}
{{- with .comments -}}
<p class="comments">Comments: {{ . }}</p>
2023-03-01 03:19:50 +00:00
{{- end -}}
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/authors.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>
{{- partial "books/rows/publish-date.html" . -}}
2023-03-01 03:19:50 +00:00
</td>
2023-03-01 03:19:50 +00:00
<td>n/a</td>
2023-10-05 18:27:13 +00:00
</tr>
2023-03-01 03:19:50 +00:00
{{ end }}
2022-12-17 18:41:44 +00:00
{{ end }}