Revision 1426:7367cd232b1e plugins/redmine_bibliography/app/helpers

View differences:

plugins/redmine_bibliography/app/helpers/publications_helper.rb
106 106
    end
107 107
  end
108 108

  
109

  
110 109
  def show_bibtex_fields(bibtex_entry)
111 110
    s = ""
112 111
    bibtex_entry.attributes.keys.sort.each do |key|
......
125 124
  end
126 125
end
127 126

  
127

  
128
def render_authorship_link(link_class, link_id)
129

  
130
  # Renders a link for an author used when adding authors for a publication
131
  # link_class can be either User or Author
132
  # link_id will be the id of the Author/User we wish to link
133

  
134
  s= ""
135

  
136
  if link_class == "Author"
137
    url = {:controller => 'authors', :action => 'show', :id => link_id}
138
    s << link_to(h(Author.find(link_id).name), url)
139
  else
140
    url = {:controller => 'users', :action => 'show', :id => link_id}
141
    s << link_to(h(User.find(link_id).name), url)
142
  end
143

  
144
  s.html_safe
145
end
146

  

Also available in: Unified diff