changeset 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 4f06dd055f19
children 2248a45897a0 8a205cc048de
files app/helpers/projects_helper.rb app/views/projects/index.rhtml config/locales/en-GB.yml config/locales/en.yml public/stylesheets/application.css
diffstat 5 files changed, 27 insertions(+), 17 deletions(-) [+]
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
 
 
--- a/app/views/projects/index.rhtml	Thu Dec 16 16:04:12 2010 +0000
+++ b/app/views/projects/index.rhtml	Thu Dec 16 16:29:06 2010 +0000
@@ -3,17 +3,15 @@
 <% end %>
 
 <div class="contextual">
-    <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
-    <%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
-    <%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
     <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
+    <%= '| ' + link_to(l(:label_issue_view_all), { :controller => 'issues' }) if User.current.allowed_to?(:view_issues, nil, :global => true) %>
+    <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
 </div>
 
 <% if User.current.logged? %>
   
   <%= render_my_project_hierarchy(@projects)%>
 
-  <h2><%=l(:label_other_project_plural)%></h2>
   <%= render_other_project_hierarchy(@projects)%>
 
 <% else %>
@@ -24,13 +22,6 @@
 
 
 
-<% if User.current.logged? %>
-<p style="text-align:right;">
-<span class="my-project"><%= l(:label_my_projects) %></span>
-</p>
-<% end %>
-
-
 <% other_formats_links do |f| %>
 	<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
 <% end %>
--- a/config/locales/en-GB.yml	Thu Dec 16 16:04:12 2010 +0000
+++ b/config/locales/en-GB.yml	Thu Dec 16 16:29:06 2010 +0000
@@ -422,6 +422,8 @@
   label_project: Project
   label_project_new: New project
   label_project_plural: Projects
+  label_my_project_plural: My Projects
+  label_other_project_plural: "Everyone Else's Projects"
   label_x_projects:
     zero:  no projects
     one:   1 project
@@ -700,7 +702,7 @@
   label_week: Week
   label_date_from: From
   label_date_to: To
-  label_language_based: Based on user's language
+  label_language_based: "Based on user's language"
   label_sort_by: "Sort by {{value}}"
   label_send_test_email: Send a test email
   label_feeds_access_key: RSS access key
@@ -841,7 +843,7 @@
   text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed.<br /> This will be used in all project-related URLs, and as the repository name. Once saved, the identifier <b>can not</b> be changed.'
   text_project_name_info: "This will be the name of your project throughout this site.<br /> You can change your project's name at any time, in the project's settings."
   text_project_visibility_info: "If your project is not public, it will only be visible to users that you have added as project members."
-  text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.<br/>This information is publicly visible in your profile and you can edit it at any time.'
+  text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.<br/>This information is publicly visible in your profile and you can edit it at any time.<br/>It may also be used to establish eligibility for your initial registration.'
   text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.'
   text_caracters_maximum: "{{count}} characters maximum."
   text_caracters_minimum: "Must be at least {{count}} characters long."
--- a/config/locales/en.yml	Thu Dec 16 16:04:12 2010 +0000
+++ b/config/locales/en.yml	Thu Dec 16 16:29:06 2010 +0000
@@ -437,7 +437,7 @@
   label_project_new: New project
   label_project_plural: Projects
   label_my_project_plural: My Projects
-  label_other_project_plural: Other Projects
+  label_other_project_plural: "Everyone Else's Projects"
   label_x_projects:
     zero:  no projects
     one:   1 project
@@ -870,7 +870,7 @@
   text_project_name_info: "This will be the name of your project throughout this site.<br /> You can change your project's name at any time, in the project's settings."
   text_project_visibility_info: "If your project is not public, it will only be visible to users that you have added as project members."
   text_project_homepage_info: 'Link to an external project page.'
-  text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.<br/>This information is publicly visible in your profile and you can edit it at any time.'
+  text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.<br/>This information is publicly visible in your profile and you can edit it at any time.<br/>It may also be used to establish eligibility for your initial registration.'
   text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.'
   text_caracters_maximum: "{{count}} characters maximum."
   text_caracters_minimum: "Must be at least {{count}} characters long."
--- a/public/stylesheets/application.css	Thu Dec 16 16:04:12 2010 +0000
+++ b/public/stylesheets/application.css	Thu Dec 16 16:29:06 2010 +0000
@@ -348,7 +348,7 @@
 ul.projects li.root { list-style-type:none; margin-bottom: 1em; }
 ul.projects li.child { list-style-type:none; margin-top: 1em;}
 ul.projects div.root a.project { /* font-family: "Trebuchet MS", Verdana, sans-serif; */ font-weight: bold; font-size: 16px; margin: 0 0 10px 0; }
-.my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
+/* .my-project { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; } */
 
 #tracker_project_ids ul { margin: 0;  padding-left: 1em; }
 #tracker_project_ids li { list-style-type:none; }