mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
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
This commit is contained in:
@@ -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 << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>\n"
|
||||
else
|
||||
@@ -75,6 +78,7 @@ module ProjectsHelper
|
||||
ancestors << project
|
||||
end
|
||||
s << ("</li></ul>\n" * ancestors.size)
|
||||
@project = original_project
|
||||
end
|
||||
s
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user