From: Eric Davis Date: Wed, 30 Jun 2010 03:32:18 +0000 (+0000) Subject: Set @project so macros will work on the welcome and project list. #5781 X-Git-Tag: 1.0.0~23 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=64d2221db526f695919eb9aba370e22ed3dc09f8;p=redmine.git 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 --- 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 %>