# HG changeset patch # User luisf # Date 1311790340 -3600 # Node ID 951fcb1711f2781a35a4a2b1358fdd4f63e07f99 # Parent d4bf55b010923a687ce6ef6314ec2d11cad3308a Addresses Feature #234 - simple layout for the authors index page. diff -r d4bf55b01092 -r 951fcb1711f2 vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb Wed Jul 27 18:39:46 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb Wed Jul 27 19:12:20 2011 +0100 @@ -1,2 +1,20 @@ module AuthorsHelper + unloadable + + def render_author_publications(author) + s = "" + pubs = [] + + author.publications.each do |pub| + pubs << link_to(pub.title, pub) + end + + if pubs.size < 3 + s << '' << pubs.join(', ') << '' + else + s << pubs.join(', ') + end + s + end + end diff -r d4bf55b01092 -r 951fcb1711f2 vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb Wed Jul 27 18:39:46 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb Wed Jul 27 19:12:20 2011 +0100 @@ -1,5 +1,26 @@

Authors#index

-<% @authors.each do |author| %> -

<%= author.name %> - <%= author.publications.first.title%>

-<% end %> \ No newline at end of file + + + + + + + + + <% @authors.each do |author|%> + + + + + + <% end %> + +
<%=l(:field_author_name)%><%=l(:field_author_username)%><%=l(:field_author_publications)%>
+ <%= h author.name %> + + <%= link_to author.user unless author.user.nil? %> + + <%= render_author_publications(author) %> +
+ diff -r d4bf55b01092 -r 951fcb1711f2 vendor/plugins/redmine_bibliography/config/locales/en.yml --- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Wed Jul 27 18:39:46 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Wed Jul 27 19:12:20 2011 +0100 @@ -9,7 +9,10 @@ field_publication_title: Title field_publication_authors: Authors - field_publication_projects: "Associated Projects" + field_publication_projects: "Associated Projects" + field_author_name: Author + field_author_username: "Associated User" + field_author_publications: "Publications by this Author" label_add_me_as_author: "Add me as an author" label_add_another_author: "Add another author"