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 @ 1317:2805873c0147
History | View | Annotate | Download (609 Bytes)
| 1 | 1126:e65c02706f1c | luis | # -*- coding: utf-8 -*-
|
|---|---|---|---|
| 2 | 328:aed18b463206 | luis | module AuthorshipsHelper |
| 3 | 702:3eb64cb3c7ac | chris | |
| 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 | 1126:e65c02706f1c | luis | if authorship.author.user.nil?
|
| 13 | 702:3eb64cb3c7ac | chris | 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 | 328:aed18b463206 | luis | end
|
| 22 | 1317:2805873c0147 | luis |