# HG changeset patch # User luisf # Date 1316191920 -3600 # Node ID 5163e3ec00b8bb3c044e35c10e3c9355eba9b435 # Parent dd366a17ab34dfb460e461bf11e0ac9401aa797d Feature #293 - The publications index page now has links to both users/authors show pages. diff -r dd366a17ab34 -r 5163e3ec00b8 vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Fri Sep 16 17:28:08 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Fri Sep 16 17:52:00 2011 +0100 @@ -72,6 +72,28 @@ str = object_name.split("\[").last().gsub("\]","") str.to_sym end + + def render_authorships_list(publication) + s = '

' + + publication.authorships.each do |authorship| + + if authorship.author.nil? + # legacy reasons… + s << h(authorship.name_on_paper) + else + if authorship.author.user.nil? + s << link_to(authorship.name_on_paper, :controller => 'authors', :action => 'show', :id => authorship.author) + else + s << link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user) + end + end + s << "
#{authorship.institution}

" + end + + s + end + def render_projects_list(publication, show_delete_icon) s= "" diff -r dd366a17ab34 -r 5163e3ec00b8 vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb Fri Sep 16 17:28:08 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb Fri Sep 16 17:52:00 2011 +0100 @@ -24,14 +24,7 @@ <%= link_to publication.title, :controller => "publications", :action => "show", :id => publication, :project_id => @project %> - <% publication.authorships.each do |authorship| %> - <%# if authorship.author.user.nil? || !authorship.author.user.active? %> - <%= h authorship.name_on_paper %> - <%# else %> - <%#= link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user) %> - <%# end %> - <%= authorship.institution %>
- <% end %> + <%= render_authorships_list(publication) %> <%= publication.bibtex_entry.year %> <%= render_projects_list(publication, false) %>