To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / vendor / plugins / redmine_bibliography / app / helpers / authorships_helper.rb @ 1078:b9e34a051f82

History | View | Annotate | Download (617 Bytes)

1
# -*- coding: undecided -*-
2
module AuthorshipsHelper
3

    
4
  # Generates a link to either author or user, depending on which is
5
  # available
6
  def link_to_authorship(authorship)
7
    s = ''
8
    if authorship.author.nil?
9
      # legacy reasons…
10
      s << h(authorship.name_on_paper)
11
    else
12
      if authorship.author.user.nil?      
13
        s << link_to(authorship.name_on_paper, :controller => 'authors', :action => 'show', :id => authorship.author)
14
      else
15
        s << link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user)
16
      end
17
    end
18
    s
19
  end
20

    
21
end