From 31935bc9c5c487e923584f4d16a62eb27d762142 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Tue, 29 Jun 2010 19:35:09 +0200 Subject: [PATCH] Set @project in project lists to allow macro rendering. --- app/helpers/projects_helper.rb | 4 ++++ app/views/welcome/index.rhtml | 1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index e3a0208..044ccfb 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 279c354..a649c2b 100644 --- a/app/views/welcome/index.rhtml +++ b/app/views/welcome/index.rhtml @@ -18,6 +18,7 @@

<%=l(:label_project_latest)%>