From 64d2221db526f695919eb9aba370e22ed3dc09f8 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 30 Jun 2010 03:32:18 +0000 Subject: [PATCH] Set @project so macros will work on the welcome and project list. #5781 Contributed by Holger Just git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3824 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/projects_helper.rb | 4 ++++ app/views/welcome/index.rhtml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index e3a020818..044ccfb77 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -56,7 +56,10 @@ module ProjectsHelper s = '' if projects.any? ancestors = [] + original_project = @project projects.each do |project| + # set the project environment to please macros. + @project = project if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) s << "\n" * ancestors.size) + @project = original_project end s end diff --git a/app/views/welcome/index.rhtml b/app/views/welcome/index.rhtml index 279c35421..a0ada7cce 100644 --- a/app/views/welcome/index.rhtml +++ b/app/views/welcome/index.rhtml @@ -18,11 +18,13 @@

<%=l(:label_project_latest)%>

<% end %> -- 2.39.5