0001-Set-project-in-project-lists-to-allow-macro-renderin.patch

Holger Just, 2010-06-29 19:51

Download (1.65 KB)

View differences:

app/helpers/projects_helper.rb
56 56
    s = ''
57 57
    if projects.any?
58 58
      ancestors = []
59
      original_project = @project
59 60
      projects.each do |project|
61
        # set the project environment to please macros.
62
        @project = project
60 63
        if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
61 64
          s << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>\n"
62 65
        else
......
75 78
        ancestors << project
76 79
      end
77 80
      s << ("</li></ul>\n" * ancestors.size)
81
      @project = original_project
78 82
    end
79 83
    s
80 84
  end
app/views/welcome/index.rhtml
18 18
	<h3><%=l(:label_project_latest)%></h3>
19 19
		<ul>
20 20
		<% for project in @projects %>
21
		  <% @project = project %>
21 22
			<li>
22 23
			<%= link_to h(project.name), :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>)
23 24
			<%= textilizable project.short_description, :project => project %>
24
-