{{ if can .current_user "edit" .book }} Edit
{{ end }} {{ template "books/book" .book }} {{ if can .current_user "edit" .book }} {{ if lt .book.PageRead .book.PageCount }}
{{ .csrf }}
{{ end }} {{ end }} {{ if can .current_user "highlight" .book }} Create Highlight {{ end }}
{{ if can .current_user "edit" .book }}
{{ .csrf }}
{{ else }} {{ if .book.ShelfID.Valid }} {{ .book.ShelfName.String }} {{ end }} {{ end }}

{{ .book.Title }}

{{ if .book.Subtitle }}

{{ .book.Subtitle }}

{{ end }}

{{ .book.Author }}

{{ if .book.Description }}

{{ .book.Description }}

{{ end }} {{ template "common/separator" }} {{ range .highlights }}

« PAGE {{ .Page }} »

{{ if can $.current_user "highlight" $.book }} {{ end }} {{ simple_format .Content }}

{{ if .Image.Valid }}
{{ end }} {{ end }}
{{ $books:=shelf_books .book.ShelfID.Int64 }} {{ if $books }}

On the same shelf

{{ range $books }}
{{ template "books/book" . }}
{{ end }}
{{ end }}