series of author

This commit is contained in:
Meutel 2015-08-15 16:04:35 +02:00
parent d08fb8c456
commit 765c8c31d7
4 changed files with 13 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class AuthorsController < ApplicationController
end end
def series def series
@author = Author.find(params[:id]) @series = Serie.find_by_sql(["select distinct s.* from series s left outer join books_series_link bsl on bsl.series = s.id left outer join books_authors_link bal on bal.book = bsl.book where bal.author = ?", params[:id]])
respond_to do |format| respond_to do |format|
format.html format.html
format.js format.js

View File

@ -1 +1,6 @@
TODO <h2><%= t(:author_serie, count: @series.count) %></h2>
<ul>
<% @series.each do |s| %>
<li><%= link_to s.name, s %></li>
<% end %>
</ul>

View File

@ -50,6 +50,9 @@ en:
author_coauthor: author_coauthor:
one: "Co-Author" one: "Co-Author"
other: "Co-Authors" other: "Co-Authors"
author_serie:
one: "Serie"
other: "Series"
will_paginate: will_paginate:
previous_label: "&#8592; Previous" previous_label: "&#8592; Previous"
next_label: "Next &#8594;" next_label: "Next &#8594;"

View File

@ -50,6 +50,9 @@ fr:
author_coauthor: author_coauthor:
one: "Co-Auteur" one: "Co-Auteur"
other: "Co-Auteurs" other: "Co-Auteurs"
author_serie:
one: "Serie"
other: "Series"
will_paginate: will_paginate:
previous_label: "&#8592; Précédent" previous_label: "&#8592; Précédent"
next_label: "Suivant &#8594;" next_label: "Suivant &#8594;"