Mercurial > hg > soundsoftware-site
comparison vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb @ 720:5eb7efd59ed7 cannam
Merge
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Mon, 17 Oct 2011 16:58:48 +0100 |
parents | 3eb64cb3c7ac |
children |
comparison
equal
deleted
inserted
replaced
719:3f7bea56f35b | 720:5eb7efd59ed7 |
---|---|
1 # -*- coding: undecided -*- | |
1 module AuthorshipsHelper | 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 | |
2 end | 21 end |