diff vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb @ 693:5163e3ec00b8 feature_36

Feature #293 - The publications index page now has links to both users/authors show pages.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 16 Sep 2011 17:52:00 +0100
parents f8d7e85ccd4e
children 3eb64cb3c7ac b6f9f005c0b6
line wrap: on
line diff
--- 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 = '<p>'
+    
+    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 << "<br /><em>#{authorship.institution}</em></p>"
+    end    
+
+    s   
+  end
+  
     
   def render_projects_list(publication, show_delete_icon)    
     s= ""