Mercurial > hg > soundsoftware-site
view plugins/redmine_bibliography/app/helpers/authorships_helper.rb @ 1519:afce8026aaeb redmine-2.4-integration
Merge from branch "live"
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:34:53 +0100 |
parents | 4ef7df804bab |
children |
line wrap: on
line source
# -*- coding: utf-8 -*- module AuthorshipsHelper # Generates a link to either author or user, depending on which is # available def link_to_authorship(authorship) s = '' if authorship.author.nil? # legacy reasons… s << h(authorship.name_on_paper) else if authorship.author.user.nil? s << link_to(authorship.name_on_paper, :controller => 'authors', :action => 'show', :id => authorship.author) else s << link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user) end end s.html_safe end end