# HG changeset patch # User luisf # Date 1311861864 -3600 # Node ID c3abeb11bc2e38439ae9776680f02b6c1449fd93 # Parent 951fcb1711f2781a35a4a2b1358fdd4f63e07f99 Addresses Issus #224 - separates the projects in a project list using commas. diff -r 951fcb1711f2 -r c3abeb11bc2e vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb --- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Wed Jul 27 19:12:20 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Thu Jul 28 15:04:24 2011 +0100 @@ -61,6 +61,23 @@ str = "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}" str.to_sym end + + def render_projects_list(publication) + s = "" + projs = [] + + publication.projects.each do |proj| + projs << link_to_project(proj) + end + + if projs.size < 3 + s << '' << projs.join(', ') << '' + else + s << projs.join(', ') + end + s + end + end diff -r 951fcb1711f2 -r c3abeb11bc2e vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb Wed Jul 27 19:12:20 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb Thu Jul 28 15:04:24 2011 +0100 @@ -1,3 +1,1 @@ -<% @publication.projects.each do |proj| %> - <%= link_to_project proj %> -<% end %> \ No newline at end of file +<%= render_projects_list(@publication) %> \ No newline at end of file