書籍詳細のタイトルに巻数を記載するように対応
authorOHASHI, Norikazu <katz@neko-mori.sakura.ne.jp>
Sun, 12 May 2019 10:43:47 +0000 (19:43 +0900)
committerOHASHI, Norikazu <katz@neko-mori.sakura.ne.jp>
Sun, 12 May 2019 10:43:47 +0000 (19:43 +0900)
sinatra/app/views/book_info.haml

index 199844b..321a4ac 100644 (file)
@@ -1,9 +1,11 @@
 - # encoding: utf-8
 - id = @id
 - book_info = @book_info
-
+- book_title = book_info[:title]
+- if book_info [:volume] != nil
+  - book_title += ": #{book_info[:volume]} 巻"
 %h2
-  「#{book_info[:title]}」
+  「#{book_title}」
 
 %image{:border => '1', :src => book_info[:cover_uri], :width => '160', :height => '230'}
   
@@ -18,9 +20,7 @@
       %th
         書名
       %td
-        #{book_info[:title]} 
-        - if book_info [:volume] != nil
-          : #{book_info[:volume]} 巻
+        #{book_title} 
     - if book_info[:series] != nil and book_info[:series] != ""
       %tr
         %th