# HG changeset patch # User luisf # Date 1291657843 0 # Node ID 60c0a4e08e099a6bce4f5095f2dc7ed02b657582 # Parent 29d087fde14247a8ab45335ca7976d55f0477bf7 Feature #35: The projects page now is separated in "My Projects" and "Other Projects". diff -r 29d087fde142 -r 60c0a4e08e09 app/helpers/projects_helper.rb --- a/app/helpers/projects_helper.rb Mon Dec 06 13:48:52 2010 +0000 +++ b/app/helpers/projects_helper.rb Mon Dec 06 17:50:43 2010 +0000 @@ -83,6 +83,94 @@ s end + + # Renders a tree of projects where the current user belongs + # as a nested set of unordered lists + # The given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen) + def render_my_project_hierarchy(projects) + s = '' + + if projects.any? + ancestors = [] + original_project = @project + projects.each do |project| + # set the project environment to please macros. + + @project = project + + if User.current.member_of?(project): + + if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) + s << "
@@ -19,6 +22,13 @@
<% end %> + + + + + + + <% other_formats_links do |f| %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <% end %> diff -r 29d087fde142 -r 60c0a4e08e09 config/locales/en.yml --- a/config/locales/en.yml Mon Dec 06 13:48:52 2010 +0000 +++ b/config/locales/en.yml Mon Dec 06 17:50:43 2010 +0000 @@ -436,6 +436,8 @@ label_project: Project label_project_new: New project label_project_plural: Projects + label_my_project_plural: My Projects + label_other_project_plural: Other Projects label_x_projects: zero: no projects one: 1 project