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 / my_helper.rb @ 1051:ef882e222003
History | View | Annotate | Download (700 Bytes)
| 1 |
module MyHelper |
|---|---|
| 2 |
|
| 3 |
def get_my_publications() |
| 4 |
if not User.current.author.nil? |
| 5 |
@my_publications = Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}") |
| 6 |
else
|
| 7 |
@my_publications = []
|
| 8 |
end
|
| 9 |
end
|
| 10 |
|
| 11 |
def render_publications_projects(publication) |
| 12 |
s = ""
|
| 13 |
projs = [] |
| 14 |
|
| 15 |
publication.projects.each do |proj|
|
| 16 |
projs << link_to(proj.name, proj) |
| 17 |
end
|
| 18 |
|
| 19 |
s << projs.join(', ')
|
| 20 |
|
| 21 |
s |
| 22 |
end
|
| 23 |
|
| 24 |
def render_publications_authors(publication) |
| 25 |
s = ""
|
| 26 |
auths = [] |
| 27 |
|
| 28 |
publication.authorships.each do |auth|
|
| 29 |
auths << h(auth.name_on_paper) |
| 30 |
end
|
| 31 |
|
| 32 |
s << auths.join(', ')
|
| 33 |
|
| 34 |
s |
| 35 |
end
|
| 36 |
|
| 37 |
|
| 38 |
end
|