view vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb @ 558:c94e23a6eff1 feature_36

Related to Bug #222Updated the look of the authors list (more intuitive to sort). Created the plugin's stylesheet file.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 03 Aug 2011 16:27:13 +0100
parents dd9d9c0ff0f9
children 999a6b3c4cd1
line wrap: on
line source
module MyHelper

  def get_my_publications()
    if not User.current.author.nil?
      @my_publications = Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}")
    else
      @my_publications = []
    end
  end 

  def render_publications_projects(publication)    
    s = ""
    projs = []
    
    publication.projects.each do |proj|
      projs << link_to(proj.name, proj)               
    end
    
    if projs.size < 3
        s << '<nobr>' << projs.join(', ') << '</nobr>'
      else
        s << projs.join(', ')
    end  
    
    s
  end

  def render_publications_authors(publication)    
    s = ""
    auths = []
          
    publication.authorships.each do |auth|
      auths << h(auth.name_on_paper)
    end
    
    if auths.size < 3
        s << '<nobr>' << auths.join(', ') << '</nobr>'
      else
        s << auths.join(', ')
    end
    s
  end


end