Bookshelf fixes
This commit is contained in:
@@ -28,7 +28,7 @@ module Adamantium
|
|||||||
|
|
||||||
def status_colour
|
def status_colour
|
||||||
case book_status
|
case book_status
|
||||||
when "read"
|
when "read" || "finished"
|
||||||
"text-green-100 bg-green-500"
|
"text-green-100 bg-green-500"
|
||||||
when "to-read"
|
when "to-read"
|
||||||
"text-blue-100 bg-blue-500"
|
"text-blue-100 bg-blue-500"
|
||||||
@@ -36,6 +36,17 @@ module Adamantium
|
|||||||
"text-orange-100 bg-orange-500"
|
"text-orange-100 bg-orange-500"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def status_label
|
||||||
|
case book_status
|
||||||
|
when "read" || "finished"
|
||||||
|
"Read"
|
||||||
|
when "to-read"
|
||||||
|
"To read"
|
||||||
|
when "reading"
|
||||||
|
"Reading"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -3,39 +3,39 @@
|
|||||||
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200"
|
||||||
h1 📚 Bookshelf
|
h1 📚 Bookshelf
|
||||||
|
|
||||||
div class="mb-12 max-w-prose mx-auto"
|
div class="mb-12 prose dark:prose-invert max-w-prose mx-auto"
|
||||||
table class="prose dark:prose-invert table-auto"
|
table class="text-gray-800 dark:text-white table-auto"
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
td class="p-2" Title
|
td class="p-2" Title
|
||||||
td class="p-2" Author(s)
|
td class="p-2" Author(s)
|
||||||
- reading.each do |book|
|
- reading.each do |book|
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
div class="rounded-md text-xs #{book.status_colour} px-2 w-full text-center"
|
div class="rounded-md uppercase text-xs #{book.status_colour} px-2 w-full text-center"
|
||||||
= book.book_status
|
= book.status_label
|
||||||
td
|
td
|
||||||
= book.name
|
= book.name
|
||||||
td
|
td
|
||||||
= book.authors
|
= book.authors
|
||||||
- to_read.each do |book|
|
- to_read.each do |book|
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
div class="rounded-md text-xs #{book.status_colour} px-2 w-full text-center"
|
div class="rounded-md uppercase text-xs #{book.status_colour} px-2 w-full text-center"
|
||||||
= book.book_status
|
= book.status_label
|
||||||
td
|
td
|
||||||
= book.name
|
= book.name
|
||||||
td
|
td
|
||||||
= book.authors
|
= book.authors
|
||||||
- read.each do |book|
|
- read.each do |book|
|
||||||
tr
|
tr
|
||||||
td
|
td
|
||||||
div class="rounded-md text-xs #{book.status_colour} px-2 w-full text-center"
|
div class="rounded-md uppercase text-xs #{book.status_colour} px-2 w-full text-center"
|
||||||
= book.book_status
|
= book.status_label
|
||||||
td
|
td
|
||||||
= book.name
|
= book.name
|
||||||
td
|
td
|
||||||
= book.authors
|
= book.authors
|
||||||
|
|
||||||
div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"
|
div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"
|
||||||
|
@@ -10,7 +10,7 @@ module Adamantium
|
|||||||
required(:slug).filled(:string)
|
required(:slug).filled(:string)
|
||||||
required(:post_type).value(included_in?: %w[book])
|
required(:post_type).value(included_in?: %w[book])
|
||||||
required(:book_author).maybe(:string)
|
required(:book_author).maybe(:string)
|
||||||
required(:book_status).value(included_in?: %w[to-read reading read])
|
required(:book_status).value(included_in?: %w[to-read reading read finished])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user