annotate vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb @ 779:06a9d1cf5e15 feature_14

Addresses Bug #331 - using a remote form to submit the "filters".
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 17 Nov 2011 23:34:18 +0000
parents 8fa35731c959
children
rev   line source
luis@328 1 module AuthorsHelper
luis@540 2 unloadable
luis@540 3
luis@540 4 def render_author_publications(author)
luis@540 5 s = ""
luis@540 6 pubs = []
luis@540 7
luis@540 8 author.publications.each do |pub|
luis@540 9 pubs << link_to(pub.title, pub)
luis@540 10 end
luis@540 11
luis@540 12 if pubs.size < 3
luis@540 13 s << '<nobr>' << pubs.join(', ') << '</nobr>'
luis@540 14 else
luis@540 15 s << pubs.join(', ')
luis@540 16 end
luis@540 17 s
luis@540 18 end
luis@540 19
luis@612 20
luis@612 21 # Generates a link to an author
luis@612 22 # todo: test options
luis@612 23 def link_to_author(author, options={}, html_options = nil)
luis@612 24 url = {:controller => 'authors', :action => 'show', :id => author}.merge(options)
luis@612 25 link_to(h(author.name), url, html_options)
luis@612 26 end
luis@612 27
luis@328 28 end