To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / plugins / redmine_bibliography / app / helpers / authorships_helper.rb @ 1431:303b9be118d4
History | View | Annotate | Download (619 Bytes)
| 1 |
# -*- coding: utf-8 -*-
|
|---|---|
| 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.html_safe |
| 19 |
end
|
| 20 |
|
| 21 |
end
|
| 22 |
|
| 23 |
|