changeset 1086:5ebdeb79ea9c feature_550

Add "My Page" box for my projects. Currently this also affects the layout of the non-My-Page version of the My Projects list, need to adjust that
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 23 Nov 2012 14:29:55 +0000
parents 3b7e11eaf1ca
children a943f341c99d
files app/controllers/my_controller.rb app/views/my/blocks/_myprojects.html.erb app/views/projects/_my.html.erb public/stylesheets/application.css public/themes/soundsoftware/stylesheets/application.css
diffstat 5 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/my_controller.rb	Fri Nov 23 13:34:20 2012 +0000
+++ b/app/controllers/my_controller.rb	Fri Nov 23 14:29:55 2012 +0000
@@ -21,6 +21,7 @@
   helper :issues
   helper :users
   helper :custom_fields
+  helper :projects
 
   BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
              'issuesreportedbyme' => :label_reported_issues,
@@ -30,7 +31,8 @@
              'tipoftheday' => :label_tipoftheday,
              'calendar' => :label_calendar,
              'documents' => :label_document_plural,
-             'timelog' => :label_spent_time
+             'timelog' => :label_spent_time,
+             'myprojects' => :label_my_projects
            }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze
 
   DEFAULT_LAYOUT = {  'left' => ['tipoftheday', 'activitymyprojects'], 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/my/blocks/_myprojects.html.erb	Fri Nov 23 14:29:55 2012 +0000
@@ -0,0 +1,9 @@
+<%  @user_projects = User.current.projects.all(:order => :name) %>
+
+<h3><%=l(:label_my_projects)%> (<%= @user_projects.count %>)</h3>
+<div class="box">
+<%=
+   render :partial => 'projects/my', :locals => { :user => User.current }
+ %>
+</div>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/projects/_my.html.erb	Fri Nov 23 14:29:55 2012 +0000
@@ -0,0 +1,1 @@
+<%= render_my_project_hierarchy(@user_projects) %>
--- a/public/stylesheets/application.css	Fri Nov 23 13:34:20 2012 +0000
+++ b/public/stylesheets/application.css	Fri Nov 23 14:29:55 2012 +0000
@@ -414,10 +414,10 @@
 
 ul.projects { margin: 0; padding-left: 1em; }
 ul.projects.root { margin: 0;  padding: 0; }
-ul.projects ul.projects { border-left: 3px solid #e0e0e0; }
+/*ul.projects ul.projects { border-left: 3px solid #e0e0e0; } */
 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-weight: bold; font-size: 16px; margin: 0 0 10px 0; }
+ul.projects li.child { list-style-type:none; }
+ul.projects div.root a.project { font-weight: bold; }
 
 li.latest { margin-bottom: 0.5em; }
 
--- a/public/themes/soundsoftware/stylesheets/application.css	Fri Nov 23 13:34:20 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/application.css	Fri Nov 23 14:29:55 2012 +0000
@@ -96,7 +96,7 @@
 table.projects .level2 .firstcol { padding-left: 2em; }
 table.projects .level3 .firstcol { padding-left: 3em; }
 
-ul.projects .public, ul.projects .private { padding-left: 0.5em; color: #3e442c; font-size: 0.95em }
+ul.projects .public, ul.projects .private { padding-left: 0.5em; color: #3e442c; font-size: 0.9em }
 
 table.files tr.active td { padding-top: 0.5em; padding-bottom: 0.5em; }
 table.files .file .active { font-weight: bold; }