Mercurial > hg > soundsoftware-site
diff app/helpers/projects_helper.rb @ 100:1412841d48a3 cannam
* Projects page: If I'm logged in but have no projects, use single All Projects heading
* Projects page: Rename "Other Projects" to "Everyone Else's Projects"
* Projects page: Remove stars from my project links; remove key explaining star
* Projects page: Reorder top-right nav links to isolate the "+ New Project" icon
author | Chris Cannam |
---|---|
date | Thu, 16 Dec 2010 16:29:06 +0000 |
parents | dc22c3eb3c81 |
children | bc91f2025d05 |
line wrap: on
line diff
--- a/app/helpers/projects_helper.rb Thu Dec 16 16:04:12 2010 +0000 +++ b/app/helpers/projects_helper.rb Thu Dec 16 16:29:06 2010 +0000 @@ -148,8 +148,12 @@ # 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_other_project_hierarchy(projects) + a = '' s = '' + # True if user has any projects (affects the heading used) + t = FALSE + if projects.any? ancestors = [] original_project = @project @@ -177,6 +181,8 @@ s << "<div class='wiki description'>#{textilizable(project.short_description, :project => project)}</div>" unless project.description.blank? s << "</div>\n" ancestors << project + else + t = TRUE end end @@ -184,8 +190,19 @@ @project = original_project end + if t == TRUE + a << "<h2>" + a << l("label_other_project_plural") + a << "</h2>" + a << s + else + a << "<h2>" + a << l("label_project_all") + a << "</h2>" + a << s + end - s + a end