To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / app / helpers / authors_helper.rb @ 723:d41bf754c0f2
History | View | Annotate | Download (591 Bytes)
| 1 | 328:aed18b463206 | luis | module AuthorsHelper |
|---|---|---|---|
| 2 | 540:951fcb1711f2 | luis | unloadable |
| 3 | |||
| 4 | def render_author_publications(author) |
||
| 5 | s = ""
|
||
| 6 | pubs = [] |
||
| 7 | |||
| 8 | author.publications.each do |pub|
|
||
| 9 | pubs << link_to(pub.title, pub) |
||
| 10 | end
|
||
| 11 | |||
| 12 | if pubs.size < 3 |
||
| 13 | s << '<nobr>' << pubs.join(', ') << '</nobr>' |
||
| 14 | else
|
||
| 15 | s << pubs.join(', ')
|
||
| 16 | end
|
||
| 17 | s |
||
| 18 | end
|
||
| 19 | |||
| 20 | 612:8fa35731c959 | luis | |
| 21 | # Generates a link to an author
|
||
| 22 | # todo: test options
|
||
| 23 | def link_to_author(author, options={}, html_options = nil) |
||
| 24 | url = {:controller => 'authors', :action => 'show', :id => author}.merge(options)
|
||
| 25 | link_to(h(author.name), url, html_options) |
||
| 26 | end
|
||
| 27 | |||
| 28 | 328:aed18b463206 | luis | end |