bouquins-ror/app/views/series/show.html.erb
2015-06-29 19:51:55 +02:00

35 lines
711 B
Plaintext

<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><%= 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
if authors
authors.uniq!
authors.sort! { |x,y| x.sort <=> y.sort }
%>
<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 %>