diff --git a/.gitignore b/.gitignore index a210281..ce31b1d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ *~ *.*.swp /vendor/ruby +/public/calibre diff --git a/app/models/book.rb b/app/models/book.rb index ccfed92..d6868ea 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -19,4 +19,8 @@ class Book < ActiveRecord::Base has_one :book_serie_link, foreign_key: "book" has_one :serie, through: :book_serie_link + + def has_cover? + has_cover == 1 + end end diff --git a/app/views/books/show.html.erb b/app/views/books/show.html.erb index 3eecd0f..be4b63f 100644 --- a/app/views/books/show.html.erb +++ b/app/views/books/show.html.erb @@ -5,50 +5,59 @@
-

- - <%= "Author".pluralize(@book.authors.count) %> -

- - <% if @book.serie %> -

- - Serie -

-
- <%= link_to @book.serie.name, @book.serie %> - <%= @book.series_index.to_i %> +

+ + <%= "Language".pluralize(@book.languages.count) %> +

+
+ <% @book.languages.each do |language| %> + <%= language.lang_code %> + <% end %> +
+

+ + <%= "Tag".pluralize(@book.tags.count) %> +

+
+ <% @book.tags.each do |tag| %> + <%= tag.name %> + <% end %> +
+

Details

+
- <% end %> -

- - <%= "Language".pluralize(@book.languages.count) %> -

-
- <% @book.languages.each do |language| %> - <%= language.lang_code %> - <% end %> +<% if @book.has_cover? %> +
+ No cover"/>
-

- - <%= "Tag".pluralize(@book.tags.count) %> -

-
- <% @book.tags.each do |tag| %> - <%= tag.name %> - <% end %> -
-

Details

- +<% end %>