smc/grandham

View on GitHub
app/views/books/show.html.haml

Summary

Maintainability
Test Coverage
.row
  = render partial: 'book_nav_links', locals: { activated_page: :show, book: @book }

%br

.row
  .col-md-8

    %h1= title @book.title
    %br

    %h4 Basic Information

    = render partial: 'books/listed_information', locals: { field: 'Authors', records: @book.authors }
    = render partial: 'books/listed_information', locals: { field: 'Publishers', records: @book.publishers }

    = book_information(@book, :isbn, 'ISBN')
    = book_information(@book, :pages, 'Pages')
    = book_information(@book, :year, 'Year')
    = book_information(@book, :edition, 'Edition')
    = book_information(@book, :series, 'Series')
    = book_information(@book, :volume, 'Volume')

    %h4 More Information

    = book_information(@book, :length, 'Length')
    = book_information(@book, :price, 'Price')
    = book_information(@book, :title_orginal, 'Original title')

    %br
    %h4 Libraries
    %ol
      - @book.libraries.each do |library|
        %li= link_to library.name, language_library_path(library.language, library)

    %h4 Description
    %p.book-information= @book.description

  .col-md-4
    .pull-right
      = image_tag book_cover_picture(@book), class: 'img-thumbnail'