improve design book, serie

This commit is contained in:
Meutel 2015-06-28 20:04:18 +02:00
parent 9ceaf42025
commit 912e347294
3 changed files with 80 additions and 23 deletions

View File

@ -34,15 +34,11 @@ h1 {
font-size: 3em;
letter-spacing: -2px;
margin-bottom: 30px;
text-align: center;
}
h2 {
font-size: 1.2em;
letter-spacing: -1px;
margin-bottom: 30px;
text-align: center;
font-weight: normal;
color: #777;
}

View File

@ -1,19 +1,54 @@
<h1><%= @book.title %></h1>
<ul>
<div class="page-header">
<h1>
<span class="glyphicon glyphicon-book"></span>
<%= @book.title %>
</h1>
</div>
<div class="row">
<h2>
<span class="glyphicon glyphicon-user"></span>
<%= "Author".pluralize(@book.authors.count) %>
</h2>
<ul>
<% @book.authors.each do |author| %>
<li><%= author.name %></li>
<% end %>
</ul>
<ul>
</ul>
<% if @book.serie %>
<h2>
<span class="glyphicon glyphicon-list"></span>
Serie
</h2>
<div>
<%= link_to @book.serie.name, @book.serie %>
<span class="badge"><%= @book.series_index.to_i %></span>
</div>
<% end %>
<h2>
<span class="glyphicon glyphicon-globe"></span>
<%= "Language".pluralize(@book.languages.count) %>
</h2>
<div>
<% @book.languages.each do |language| %>
<li><%= language.lang_code %></li>
<%= language.lang_code %>
<% end %>
</ul>
<ul>
</div>
<h2>
<span class="glyphicon glyphicon-tags"></span>
<%= "Tag".pluralize(@book.tags.count) %>
</h2>
<div>
<% @book.tags.each do |tag| %>
<li><%= tag.name %></li>
<span class="label label-info"><%= tag.name %></span>
<% end %>
</ul>
<p>Serie: <%= @book.serie.name %></p>
<p>Publisher: <%= @book.publisher.name %></p>
<p>Publishing date: <%= @book.pubdate.to_formatted_s(:date) %></p>
</div>
<h2>Details</h2>
<ul>
<% if @book.pubdate %>
<li><strong>Publishing date</strong> <%= @book.pubdate.to_formatted_s(:date) %></li>
<% end %>
<% if @book.publisher %>
<li><strong>Publisher</strong> <%= @book.publisher.name %></li>
<% end %>
</ul>
</div>

View File

@ -1,6 +1,32 @@
<h1><%= @serie.name %></h1>
<div class="page-header">
<h1>
<span class="glyphicon glyphicon-list"></span>
<%= @serie.name %>
</h1>
</div>
<h2>
<span class="glyphicon glyphicon-book"></span>
<%= "Book".pluralize(@serie.books.count) %>
</h2>
<ul>
<% @serie.books.each do |book| %>
<li><%= link_to book.title, book %></li>
<li><%= book.series_index.to_i %>. <%= link_to book.title, book %></li>
<% end %>
</ul>
<%
authors = Array.new
@serie.books.each do |book|
authors.concat book.authors
end
authors.uniq!.sort! { |x,y| x.sort <=> y.sort }
if authors %>
<h2>
<span class="glyphicon glyphicon-user"></span>
<%= "Author".pluralize(authors.count) %>
</h2>
<ul>
<% authors.each do |author| %>
<li><%= link_to author.name, author %></li>
<% end%>
</ul>
<% end %>