diff vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb @ 540:951fcb1711f2 feature_36

Addresses Feature #234 - simple layout for the authors index page.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 27 Jul 2011 19:12:20 +0100
parents aed18b463206
children 8fa35731c959
line wrap: on
line diff
--- 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 << '<nobr>' << pubs.join(', ') << '</nobr>'
+    else
+      s << pubs.join(', ')
+    end
+    s    
+  end
+  
 end