From b2f48c5c3ae6e11f0ac070c5b341b57c0f042175 Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Fri, 18 Nov 2011 11:09:47 -0400 Subject: [PATCH 1/9] Fixed for 1.1.2 Fixed the project page links for 1.1.2 Redmine. --- app/views/projects/index.rhtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml index 03b3dd1..ffdb56e 100644 --- a/app/views/projects/index.rhtml +++ b/app/views/projects/index.rhtml @@ -1,11 +1,11 @@
<% if authorize_global_implemented %> - <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, 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) %> <% else %> - <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.admin? %> + <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.admin? %> <% end %> <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> | - <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%> + <%= link_to l(:label_overall_activity), { :controller => 'activity' }%>

<%=l(:label_project_plural)%>

From eed2094945327098ea8d30935efd30fc6d810534 Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Fri, 18 Nov 2011 11:17:59 -0400 Subject: [PATCH 2/9] Another fix for 1.1.2 Another issue on the show projects page with time. --- app/views/projects/show.rhtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index 12c4a96..e7c310f 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -116,8 +116,8 @@ <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>

<%= l(:label_spent_time) %>

<%= l_hours(@total_hours) %>

-

<%= link_to(l(:label_details), {:controller => 'timelog', :action => 'details', :project_id => @project}) %> | - <%= link_to(l(:label_report), {:controller => 'timelog', :action => 'report', :project_id => @project}) %>

+

<%= link_to(l(:label_details), {:controller => 'time_entries', :project_id => @project}) %> | + <%= link_to(l(:label_report), {:controller => 'time_entries', :action => 'report', :project_id => @project}) %>

<% end %> <% end %> From b7066b4f705d374aae4f6386e15e2ce3674dd054 Mon Sep 17 00:00:00 2001 From: dubcanada Date: Fri, 18 Nov 2011 11:21:16 -0400 Subject: [PATCH 3/9] Update README.rdoc --- README.rdoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index cb1dabb..22d80be 100644 --- a/README.rdoc +++ b/README.rdoc @@ -6,6 +6,7 @@ propagates the tree view to the project show page's subprojects list. ==Author * Chris Peterson +* Edits by: Steven Verbeek ==Changelog @@ -21,11 +22,12 @@ This plugin is compatible with Redmine trunk only! ==Obtaining -URL of the GitHub repository: http://github.com/MischaTheEvil/projects_tree_view/tree/master +URL of the GitHub repository: http://github.com/dubcanada/projects_tree_view/tree/master +URL of the original GitHub repository: http://github.com/MischaTheEvil/projects_tree_view/tree/master The source of this plugin can be "cloned" from the GitHub-repo using: -$ cd {RAILS_ROOT}/vendor/plugins && git clone git://github.com/MischaTheEvil/projects_tree_view.git +$ cd {RAILS_ROOT}/vendor/plugins && git clone git://github.com/dubcanada/projects_tree_view.git ==Installation From a503aa8bbbcdbf245df2d9aa555484a9b5c92ab2 Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Fri, 18 Nov 2011 11:24:10 -0400 Subject: [PATCH 4/9] Added myself to the authors list Did some small changes. --- README.rdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rdoc b/README.rdoc index 22d80be..7668405 100644 --- a/README.rdoc +++ b/README.rdoc @@ -6,7 +6,11 @@ propagates the tree view to the project show page's subprojects list. ==Author * Chris Peterson +<<<<<<< HEAD * Edits by: Steven Verbeek +======= +* Small Edits By: Steven Verbeek +>>>>>>> Added myself to the authors list ==Changelog From 3deca1552ef250741a6fc38e3242aa7d69fa365b Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Fri, 18 Nov 2011 11:27:29 -0400 Subject: [PATCH 5/9] Fix --- README.rdoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rdoc b/README.rdoc index 7668405..b9d580f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -7,10 +7,13 @@ propagates the tree view to the project show page's subprojects list. * Chris Peterson <<<<<<< HEAD +<<<<<<< HEAD * Edits by: Steven Verbeek ======= * Small Edits By: Steven Verbeek >>>>>>> Added myself to the authors list +======= +>>>>>>> parent of b7066b4... Update README.rdoc ==Changelog @@ -26,12 +29,11 @@ This plugin is compatible with Redmine trunk only! ==Obtaining -URL of the GitHub repository: http://github.com/dubcanada/projects_tree_view/tree/master -URL of the original GitHub repository: http://github.com/MischaTheEvil/projects_tree_view/tree/master +URL of the GitHub repository: http://github.com/MischaTheEvil/projects_tree_view/tree/master The source of this plugin can be "cloned" from the GitHub-repo using: -$ cd {RAILS_ROOT}/vendor/plugins && git clone git://github.com/dubcanada/projects_tree_view.git +$ cd {RAILS_ROOT}/vendor/plugins && git clone git://github.com/MischaTheEvil/projects_tree_view.git ==Installation From 1a3923e9fee803f0a2679c4bc7c4e5d8d92bec54 Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Fri, 18 Nov 2011 11:28:39 -0400 Subject: [PATCH 6/9] Revert eed2094945327098ea8d30935efd30fc6d810534^..HEAD --- .DS_Store | Bin 0 -> 6148 bytes README.rdoc | 8 -------- app/.DS_Store | Bin 0 -> 6148 bytes app/views/.DS_Store | Bin 0 -> 6148 bytes app/views/projects/.DS_Store | Bin 0 -> 6148 bytes app/views/projects/show.rhtml | 4 ++-- 6 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 .DS_Store create mode 100644 app/.DS_Store create mode 100644 app/views/.DS_Store create mode 100644 app/views/projects/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b4fe00921abb152a53406d4340fff73559815292 GIT binary patch literal 6148 zcmeHK%Z}496uq8?nS}D_1_`m5h;^x21}F;_oziNi5|0rXX%-X>NmJTLQBox-MJk1W zkoW+;gg@XbkocN%>==}^Wrc)LM$j~zQ9BG#U|4WbGW=|~*4i^w(@Z|7;v zc4W;}AQOF9lu$?!4SW6?TU96plmh>o0{q!Es74*K=p5?5(|QuHQS&McnDF~2$!-;0xa{X5$!X%}|) zbi>du_0PP(4QK6e8o2RuYaGrj&mB5;^g@&qJDJ99I}$A?b}~kbD4&L*k8)qK&pbC7 zpI2_o=eHX5Mzd-j+`hZ0n)7C}UN!F=++QpVT{kM9^=mh44~|dmckj~=A4QrQE*}IS+#%~B|;}s#kp*=5`K@aJe4(SOUQI{UkQ#vYo@P(ka zIe~X+fCD$6S6GZukt<}*bNA5e33{y|k~gbM$9OD7wugSP#NbEd6#Eu&{K& z8)L}xO5k~`y@|2&tTLkPL5nVwu#j(zSZvCBxfsgy4BSI(<;TJ&A{W{Wiji|wSl&y+ z42M{sm95NUD)1oBwwc__dU@L>rsks*PzwCD0{nb1kvO&_rWuN(1DW^)0BWcfhBAL) z;6A3rmc%qew7^*A3d~%Y{KR0HJL*lzYe`Hq%-o5Ik1d1;2i1)02# hMS)+%*O7#w&Ey4OOJbTKYGCR`K**pnrNBQ`;3vo6;;H}u literal 0 HcmV?d00001 diff --git a/README.rdoc b/README.rdoc index b9d580f..cb1dabb 100644 --- a/README.rdoc +++ b/README.rdoc @@ -6,14 +6,6 @@ propagates the tree view to the project show page's subprojects list. ==Author * Chris Peterson -<<<<<<< HEAD -<<<<<<< HEAD -* Edits by: Steven Verbeek -======= -* Small Edits By: Steven Verbeek ->>>>>>> Added myself to the authors list -======= ->>>>>>> parent of b7066b4... Update README.rdoc ==Changelog diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..084e32e94045a411c30c3b97663c980a46c3bf21 GIT binary patch literal 6148 zcmeHKOKaOe5T13MMxqaVDTG|Q^y~(^X>krc2;)F=D=3gdTvDkrwLo}-CC3NjRxO48 zp8lEs9rxSWbx7*;8k#Z#v)^bQ`}ibwwM3-)v#d+hBBB6lu@R!VMQq&ahBUmV2~^xi zOcfcL(&)I@$QH-H$bfx!A??$EVmgOjy+89YEli3iJ`ME*_-w_(i`b@1%4tM%Dvyin znKZPSP_r`v1mgO{(DZN2FAI&J;x z;BdJNgCK1E2%bLQfAjVv`TV8+`i&<`3ZF5{V~=b24&&OQFXQQ?Fq2R4t}E7=g2I3> zAPn3C2K?3)JiG^Ul_?4X!ob}!VD|?NwHSG<9rD(JhOYoX`y0su+ukK?jrJIMtQ{f( zQLYr|N|nE2C|3@@_IZ)V+Mz2a#UrC1KeF;S6vd;%uQ{Dm5gg5S?}0R-zyH5-7cN>Ddi-)8ZU@5XOb(R!|^^IHXc!Y8T-(mRuiyY5|nwl~Lvu`vXyQ{ZiS4%{yJImTc4I&Dl7Hc7zJH*DVZb;30>OjSP z#8i@@DGd(ujcjpjBLjBrLfWGq#dHR}UO#i5<|aiHpN4t{e7R!bmk4NrRW|gM26T>^ z;xNCNPkoyYRjbwA`RTlv`2K&TlYCT^t=4Z<+o?Zz_$Ua&;7R{@G|tStYi8rDIEja5 z9*?p?noLjGE|YRrbdxDZJ|*Q45w?$v$zk_>_VFkyhi8o!i^c19tKDhp{WtHHO}*%J zT21|S|6sWcgCK1D40d1bz5jTWTzs#7T=JAj;ge>0>TwNMFg6JI7Ei~y8Gk`+UAN8` z6b6I=VPNYR@EcX|c*z5)R4ZzKzBdzY{^+GFIg za)<~-xl*7jRsM>hTsi#O=S3bXhpwCykBol&$jaYP6ps$S=5$h#LurKpVc<3cJMOVz z&;Jj9zyIGZk|$w682GOkQ1xEi>*AIC*}Cy^_N>*=&rmBiuX1=@0)vlY literal 0 HcmV?d00001 diff --git a/app/views/projects/.DS_Store b/app/views/projects/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ae15afe4f3ce70fb1c0a8d979e0a3733b86062c9 GIT binary patch literal 6148 zcmeHK%Sr=55Ukc5q5;X#oAU*Nf3Sr0kn>&zB_^P-x)2pT?x*=@TKzDXxZXrWx?#FH z(_J&W1)13fAhW0C888Jf=1>$3227_1Q+rXoPZV3D!6Q1Xv6{C73;o3@ef9&KqDF&D zj?MFT*Ne7WFiUCVm3Z=I#t4|;7WY_Ug%@(yxFPQj?Y#ZW!o?2j5D%>E@ccbTj&?Y@ zTUsiR3Zw$5Kq~N)3h>TW8&4e5rvj-!DzH&N&xgXHSOxZuc688L3qTxk+KjRG63Quo zRbcPP3{9L$bgD#)Ax`IfiMlGVcXT==nh%McKbjY@-MN0Ta!BQvJ{3p>wiVFcmp0Y= z|D1oB!6x5I(xn2az<*UhMs-uq_;zu(etA#5YYWE}hnm*)8qgSTeFX4_o+HPW^nB5n YbyZ;RsH^C_(TVvXV1lGe1%5$+cc7m(0{{R3 literal 0 HcmV?d00001 diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index e7c310f..12c4a96 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -116,8 +116,8 @@ <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>

<%= l(:label_spent_time) %>

<%= l_hours(@total_hours) %>

-

<%= link_to(l(:label_details), {:controller => 'time_entries', :project_id => @project}) %> | - <%= link_to(l(:label_report), {:controller => 'time_entries', :action => 'report', :project_id => @project}) %>

+

<%= link_to(l(:label_details), {:controller => 'timelog', :action => 'details', :project_id => @project}) %> | + <%= link_to(l(:label_report), {:controller => 'timelog', :action => 'report', :project_id => @project}) %>

<% end %> <% end %> From 25b03615984dc9c1b9951923714faaff91a25327 Mon Sep 17 00:00:00 2001 From: cforce Date: Thu, 1 Dec 2011 15:37:20 +0100 Subject: [PATCH 7/9] 0.0.4 (2010-06-23): * Sync with Redmine 0.9.4 * Added plugin functionality to admin/projects page * Fix problem with projects without active children * Deleted unuseful plugin-skeleton files * added js exapnd all button * Fixed missing spent time link --- .DS_Store | Bin 6148 -> 0 bytes CHANGELOG | 7 + app/.DS_Store | Bin 6148 -> 0 bytes app/views/.DS_Store | Bin 6148 -> 0 bytes app/views/admin/projects.rhtml | 92 ++++++++ app/views/projects/index.rhtml | 172 ++++++++------- assets/javascripts/projects_tree_view.js | 197 +++++++++--------- init.rb | 5 +- lib/projectstreeview_projects_helper_patch.rb | 1 + 9 files changed, 297 insertions(+), 177 deletions(-) delete mode 100644 .DS_Store delete mode 100644 app/.DS_Store delete mode 100644 app/views/.DS_Store create mode 100644 app/views/admin/projects.rhtml diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index b4fe00921abb152a53406d4340fff73559815292..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%Z}496uq8?nS}D_1_`m5h;^x21}F;_oziNi5|0rXX%-X>NmJTLQBox-MJk1W zkoW+;gg@XbkocN%>==}^Wrc)LM$j~zQ9BG#U|4WbGW=|~*4i^w(@Z|7;v zc4W;}AQOF9lu$?!4SW6?TU96plmh>o0{q!Es74*K=p5?5(|QuHQS&McnDF~2$!-;0xa{X5$!X%}|) zbi>du_0PP(4QK6e8o2RuYaGrj&mB5;^g@&qJDJ99I}$A?b}~kbD4&L*k8)qK&pbC7 zpI2_o=eHX5Mzd-j+`hZ0n)7C}UN!F=++QpVT{kM9^=mh44~|dmckj~=A4QrQE*}IS+#%~B|;}s#kp*=5`K@aJe4(SOUQI{UkQ#vYo@P(ka zIe~X+fCD$6S6GZukt<}*bNA5e33{y|k~gbM$9OD7wugSP#NbEd6#Eu&{K& z8)L}xO5k~`y@|2&tTLkPL5nVwu#j(zSZvCBxfsgy4BSI(<;TJ&A{W{Wiji|wSl&y+ z42M{sm95NUD)1oBwwc__dU@L>rsks*PzwCD0{nb1kvO&_rWuN(1DW^)0BWcfhBAL) z;6A3rmc%qew7^*A3d~%Y{KR0HJL*lzYe`Hq%-o5Ik1d1;2i1)02# hMS)+%*O7#w&Ey4OOJbTKYGCR`K**pnrNBQ`;3vo6;;H}u diff --git a/CHANGELOG b/CHANGELOG index 1899a23..a09c0cd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +0.0.4 (2010-06-23): + * Sync with Redmine 0.9.4 + * Added plugin functionality to admin/projects page + * Fix problem with projects without active children + * Deleted unuseful plugin-skeleton files + * added js exapnd all button + * Fixed missing spent time link 0.0.3 (2009-08-02): * Improved documentation and licensing * Updated the core-overriding views (required compatibility-helpers, see below) diff --git a/app/.DS_Store b/app/.DS_Store deleted file mode 100644 index 084e32e94045a411c30c3b97663c980a46c3bf21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOKaOe5T13MMxqaVDTG|Q^y~(^X>krc2;)F=D=3gdTvDkrwLo}-CC3NjRxO48 zp8lEs9rxSWbx7*;8k#Z#v)^bQ`}ibwwM3-)v#d+hBBB6lu@R!VMQq&ahBUmV2~^xi zOcfcL(&)I@$QH-H$bfx!A??$EVmgOjy+89YEli3iJ`ME*_-w_(i`b@1%4tM%Dvyin znKZPSP_r`v1mgO{(DZN2FAI&J;x z;BdJNgCK1E2%bLQfAjVv`TV8+`i&<`3ZF5{V~=b24&&OQFXQQ?Fq2R4t}E7=g2I3> zAPn3C2K?3)JiG^Ul_?4X!ob}!VD|?NwHSG<9rD(JhOYoX`y0su+ukK?jrJIMtQ{f( zQLYr|N|nE2C|3@@_IZ)V+Mz2a#UrC1KeF;S6vd;%uQ{Dm5gg5S?}0R-zyH5-7cN>Ddi-)8ZU@5XOb(R!|^^IHXc!Y8T-(mRuiyY5|nwl~Lvu`vXyQ{ZiS4%{yJImTc4I&Dl7Hc7zJH*DVZb;30>OjSP z#8i@@DGd(ujcjpjBLjBrLfWGq#dHR}UO#i5<|aiHpN4t{e7R!bmk4NrRW|gM26T>^ z;xNCNPkoyYRjbwA`RTlv`2K&TlYCT^t=4Z<+o?Zz_$Ua&;7R{@G|tStYi8rDIEja5 z9*?p?noLjGE|YRrbdxDZJ|*Q45w?$v$zk_>_VFkyhi8o!i^c19tKDhp{WtHHO}*%J zT21|S|6sWcgCK1D40d1bz5jTWTzs#7T=JAj;ge>0>TwNMFg6JI7Ei~y8Gk`+UAN8` z6b6I=VPNYR@EcX|c*z5)R4ZzKzBdzY{^+GFIg za)<~-xl*7jRsM>hTsi#O=S3bXhpwCykBol&$jaYP6ps$S=5$h#LurKpVc<3cJMOVz z&;Jj9zyIGZk|$w682GOkQ1xEi>*AIC*}Cy^_N>*=&rmBiuX1=@0)vlY diff --git a/app/views/admin/projects.rhtml b/app/views/admin/projects.rhtml new file mode 100644 index 0000000..90b6360 --- /dev/null +++ b/app/views/admin/projects.rhtml @@ -0,0 +1,92 @@ +
+<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %> +
+ +

<%=l(:label_project_plural)%>

+ +<% form_tag({}, :method => :get) do %> +
<%= l(:label_filter_plural) %> + +<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> + +<%= text_field_tag 'name', params[:name], :size => 30 %> +<%= submit_tag l(:button_apply), :class => "small", :name => nil %> +
+<% end %> +  + +
+ + + + + + + + + +<% ancestors = [] %> +<% for project in @projects %> + <% rowid = "" %> + <% classes = "" %> + <% spanicon = "" %> + <% openonclick = "" %> + <% showchildren = false %> + <% project.children.each do |child| %> + <% if @projects.include?(child) %> + <% showchildren = true %> + <% break %> + <% end %> + <% end %> + <% if(!project.children.empty? && showchildren) %> + <% classes += " closed parent " + cycle("odd", "even") %> + <% rowid = "id=\""+project.id.to_s+"span\"" %> + <% openonclick = "onclick=\"showHide('"+project.id.to_s+"','"+project.id.to_s+"span')\""%> + <% spanicon = "  " %> + <% else %> + <% classes += " child" %> + <% end %> + <% if(project.parent_id == nil) %> + <% ancestors.clear %> + <% ancestors << project.id %> + <% else %> + <% while (ancestors.any? && !(project.parent_id == ancestors.last)) %> + <% ancestors.pop %> + <% end %> + <% classes += " hide" %> + <% if( !(ancestors.detect {|pid| pid == project.parent_id })) %> + <% prvclasses = "closed show parent " + cycle("odd", "even") %> + <% ancestors.each do |pid| %> + <% prvclasses += " " + pid.to_s %> + <% end %> + <% openonclick = "onclick=\"showHide('"+project.parent_id.to_s+"','"+project.parent_id.to_s+"span')\"" %> + " > + + + + + <% ancestors << project.parent_id %> + <% end %> + <% ancestors.each do |pid| %> + <% classes += " " + pid.to_s %> + <% end %> + <% ancestors << project.id %> + <% end %> + > + + + + + + +<% end %> + +
<%=l(:label_project)%><%=l(:field_description)%><%=l(:field_is_public)%><%=l(:field_created_on)%>
<%= "" %><%="  " %><%= h("") %> class="empty">  >Project is private.
<%= "" %><%= spanicon %><%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %> ><%= textilizable project.short_description, :project => project %><%= image_tag 'true.png' if project.is_public? %><%= format_date(project.created_on) %> + <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %> + <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %> + <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %> + <%= link_to(l(:button_delete), project_destroy_confirm_path(project), :class => 'icon icon-del') %> +
+
+ +<% html_title(l(:label_project_plural)) -%> diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml index ffdb56e..f40c322 100644 --- a/app/views/projects/index.rhtml +++ b/app/views/projects/index.rhtml @@ -1,79 +1,93 @@ -
- <% if authorize_global_implemented %> - <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %> - <% else %> - <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.admin? %> - <% end %> - <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> | - <%= link_to l(:label_overall_activity), { :controller => 'activity' }%> -
- -

<%=l(:label_project_plural)%>

- - - - - - - - - - <% ancestors = [] %> - <% for project in @projects %> - <% rowid = "" %> - <% classes = "" %> - <% spanicon = "" %> - <% openonclick = "" %> - <% if(!project.children.empty?) %> - <% classes += " closed parent " + cycle("odd", "even") %> - <% rowid = "id=\""+project.id.to_s+"span\"" %> - <% openonclick = "onclick=\"showHide('"+project.id.to_s+"','"+project.id.to_s+"span')\""%> - <% spanicon = "  " %> - <% else %> - <% classes += " child" %> - <% end %> - <% if(project.parent_id == nil) %> - <% ancestors.clear %> - <% ancestors << project.id %> - <% else %> - <% while (ancestors.any? && !(project.parent_id == ancestors.last)) %> - <% ancestors.pop %> - <% end %> - <% classes += " hide" %> - <% if( !(ancestors.detect {|pid| pid == project.parent_id })) %> - <% prvclasses = "closed show parent " + cycle("odd", "even") %> - <% ancestors.each do |pid| %> - <% prvclasses += " " + pid.to_s %> - <% end %> - <% openonclick = "onclick=\"showHide('"+project.parent_id.to_s+"','"+project.parent_id.to_s+"span')\"" %> - " > - - - - - <% ancestors << project.parent_id %> - <% end %> - <% ancestors.each do |pid| %> - <% classes += " " + pid.to_s %> - <% end %> - <% ancestors << project.id %> - <% end %> - > - - - - <% end %> - -
<%=l(:label_project)%><%=l(:field_description)%>
<%= "" %><%="  " %><%= h("") %> class="empty">  >Project is private.
<%= "" %><%= spanicon %><%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %> class="empty <%=User.current.member_of?(project) ? 'my-project' : nil%>">  ><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %>
- -<% if User.current.logged? %> -

-<%= l(:label_my_projects) %> -

-<% end %> - -<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<% end %> - -<% html_title(l(:label_project_plural)) -%> +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> +<% end %> +
+ <% if authorize_global_implemented %> + <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %> + <% else %> + <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.admin? %> + <% end %> + <%= 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' }%> +
+ +

<%=l(:label_project_plural)%>

+ + + + + + + + + + <% ancestors = [] %> + <% for project in @projects %> + <% rowid = "" %> + <% classes = "" %> + <% spanicon = "" %> + <% openonclick = "" %> + <% showchildren = false %> + <% project.children.each do |child| %> + <% if @projects.include?(child) %> + <% showchildren = true %> + <% break %> + <% end %> + <% end %> + <% if(!project.children.empty? && showchildren) %> + <% classes += " closed parent " + cycle("odd", "even") %> + <% rowid = "id=\""+project.id.to_s+"span\"" %> + <% openonclick = "onclick=\"showHide('"+project.id.to_s+"','"+project.id.to_s+"span')\""%> + <% spanicon = "  " %> + <% else %> + <% classes += " child" %> + <% end %> + <% if(project.parent_id == nil) %> + <% ancestors.clear %> + <% ancestors << project.id %> + <% else %> + <% while (ancestors.any? && !(project.parent_id == ancestors.last)) %> + <% ancestors.pop %> + <% end %> + <% classes += " hide" %> + <% if( !(ancestors.detect {|pid| pid == project.parent_id })) %> + <% prvclasses = "closed show parent " + cycle("odd", "even") %> + <% ancestors.each do |pid| %> + <% prvclasses += " " + pid.to_s %> + <% end %> + <% openonclick = "onclick=\"showHide('"+project.parent_id.to_s+"','"+project.parent_id.to_s+"span')\"" %> + " > + + + + + <% ancestors << project.parent_id %> + <% end %> + <% ancestors.each do |pid| %> + <% classes += " " + pid.to_s %> + <% end %> + <% ancestors << project.id %> + <% end %> + > + + + + <% end %> + +
<%=l(:label_project)%><%=l(:field_description)%>
<%= "" %><%="  " %><%= h("") %> class="empty">  >Project is private.
<%= "" %><%= spanicon %><%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %> class="empty <%=User.current.member_of?(project) ? 'my-project' : nil%>">  ><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %>
+ +Expand All + + +<% if User.current.logged? %> +

+<%= l(:label_my_projects) %> +

+<% end %> + +<% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<% end %> + +<% html_title(l(:label_project_plural)) -%> diff --git a/assets/javascripts/projects_tree_view.js b/assets/javascripts/projects_tree_view.js index 7cd26af..02c2e79 100644 --- a/assets/javascripts/projects_tree_view.js +++ b/assets/javascripts/projects_tree_view.js @@ -1,94 +1,103 @@ -/* Function to allow the projects to show up as a tree */ - -function showHide(EL,PM) -{ - var els = document.getElementsByTagName('tr'); - var elsLen = els.length; - var pattern = new RegExp("(^|\\s)"+EL+"(\\s|$)"); - var cpattern = new RegExp("span"); - var expand = new RegExp("open"); - var collapse = new RegExp("closed"); - var hide = new RegExp("hide"); - var spanid = PM; - var classid = new RegExp("junk"); - var oddeventoggle = 0; - for (i = 0; i < elsLen; i++) - { - - if(cpattern.test(els[i].id)) - { - var tmpspanid = spanid; - var tmpclassid = classid; - spanid = els[i].id; - classid = spanid; - classid = classid.match(/(\w+)span/)[1]; - classid = new RegExp(classid); - if(tmpclassid.test(els[i].className) && (tmpspanid.toString() != PM.toString())) - { - if(collapse.test(document.getElementById(tmpspanid).className)) - { - spanid = tmpspanid; - classid = tmpclassid; - } - } - } - - if ( pattern.test(els[i].className) ) { - - var cnames = els[i].className; - - cnames = cnames.replace(/hide/g,''); - - if (expand.test(document.getElementById(PM).className)) - { - cnames += ' hide'; - } - else - { - if((spanid.toString() != PM.toString()) && - (classid.test(els[i].className))) - { - if(collapse.test(document.getElementById(spanid).className)) - { - cnames += ' hide'; - } - } - } - - els[i].className = cnames; - - } - - if(!(hide.test(els[i].className))) - { - var cnames = els[i].className; - cnames = cnames.replace(/odd/g,''); - cnames = cnames.replace(/even/g,''); - - if(oddeventoggle == 0) - { - cnames += ' odd'; - } - else - { - cnames += ' even'; - } - - oddeventoggle ^= 1; - els[i].className = cnames; - } - } - if (collapse.test(document.getElementById(PM).className)) - { - var cnames = document.getElementById(PM).className; - cnames = cnames.replace(/closed/,'open'); - document.getElementById(PM).className = cnames; - } - else - { - var cnames = document.getElementById(PM).className; - cnames = cnames.replace(/open/,'closed'); - document.getElementById(PM).className = cnames; - } -} - +/* Function to allow the projects to show up as a tree */ + + Event.observe(window, 'load', function() { + if ($('expand_all')) { + $('expand_all').observe('click', function() { + $$('table.list tr').each(function(e) { e.addClassName('open'); e.removeClassName('hide'); }); + }); + } + }); + + +function showHide(EL,PM) +{ + var els = document.getElementsByTagName('tr'); + var elsLen = els.length; + var pattern = new RegExp("(^|\\s)"+EL+"(\\s|$)"); + var cpattern = new RegExp("span"); + var expand = new RegExp("open"); + var collapse = new RegExp("closed"); + var hide = new RegExp("hide"); + var spanid = PM; + var classid = new RegExp("junk"); + var oddeventoggle = 0; + for (i = 0; i < elsLen; i++) + { + + if(cpattern.test(els[i].id)) + { + var tmpspanid = spanid; + var tmpclassid = classid; + spanid = els[i].id; + classid = spanid; + classid = classid.match(/(\w+)span/)[1]; + classid = new RegExp(classid); + if(tmpclassid.test(els[i].className) && (tmpspanid.toString() != PM.toString())) + { + if(collapse.test(document.getElementById(tmpspanid).className)) + { + spanid = tmpspanid; + classid = tmpclassid; + } + } + } + + if ( pattern.test(els[i].className) ) { + + var cnames = els[i].className; + + cnames = cnames.replace(/hide/g,''); + + if (expand.test(document.getElementById(PM).className)) + { + cnames += ' hide'; + } + else + { + if((spanid.toString() != PM.toString()) && + (classid.test(els[i].className))) + { + if(collapse.test(document.getElementById(spanid).className)) + { + cnames += ' hide'; + } + } + } + + els[i].className = cnames; + + } + + if(!(hide.test(els[i].className))) + { + var cnames = els[i].className; + cnames = cnames.replace(/odd/g,''); + cnames = cnames.replace(/even/g,''); + + if(oddeventoggle == 0) + { + cnames += ' odd'; + } + else + { + cnames += ' even'; + } + + oddeventoggle ^= 1; + els[i].className = cnames; + } + } + if (collapse.test(document.getElementById(PM).className)) + { + var cnames = document.getElementById(PM).className; + cnames = cnames.replace(/closed/,'open'); + document.getElementById(PM).className = cnames; + } + else + { + var cnames = document.getElementById(PM).className; + cnames = cnames.replace(/open/,'closed'); + document.getElementById(PM).className = cnames; + } +} + diff --git a/init.rb b/init.rb index a1add96..eee09a0 100644 --- a/init.rb +++ b/init.rb @@ -3,15 +3,12 @@ # Patches to the Redmine core. require 'dispatcher' require 'projectstreeview_projects_helper_patch' -Dispatcher.to_prepare do - ProjectsHelper.send(:include, ProjectstreeviewProjectsHelperPatch) -end Redmine::Plugin.register :projects_tree_view do name 'Projects Tree View plugin' author 'Chris Peterson' description 'This is a Redmine plugin which will turn the projects page into a tree view' - version '0.0.3' + version '0.0.4' end class ProjectsTreeViewListener < Redmine::Hook::ViewListener diff --git a/lib/projectstreeview_projects_helper_patch.rb b/lib/projectstreeview_projects_helper_patch.rb index bb372ad..0dd3b00 100644 --- a/lib/projectstreeview_projects_helper_patch.rb +++ b/lib/projectstreeview_projects_helper_patch.rb @@ -30,3 +30,4 @@ def authorize_global_implemented end # Close the module ProjectstreeviewProjectsHelperPatch::InstanceMethods end # Close the module ProjectstreeviewProjectsHelperPatch +ProjectsHelper.send(:include, ProjectstreeviewProjectsHelperPatch) From 5287fa1003abc09971b6d862fd46b1969ca53c00 Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Thu, 1 Dec 2011 10:58:16 -0400 Subject: [PATCH 8/9] Edited the README --- README.rdoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.rdoc b/README.rdoc index cb1dabb..0e1cbd9 100644 --- a/README.rdoc +++ b/README.rdoc @@ -3,9 +3,11 @@ Projects Tree View is a Redmine plugin which will turn the projects index view into a tree view. It also propagates the tree view to the project show page's subprojects list. -==Author +==Author(s) -* Chris Peterson +* cforce (edits) +* Steven Verbeek (edits) +* Chris Peterson (original) ==Changelog @@ -13,19 +15,19 @@ For the complete changelog see the CHANGELOG-file in the Projects Tree ==Latest stable release -The currently available, latest stable release of the plugin is version 0.0.3. +The currently available, latest stable release of the plugin is version 0.0.4. ==Compatibility -This plugin is compatible with Redmine trunk only! +This plugin is compatible with Redmine 0.9.4-1.2.1 ==Obtaining -URL of the GitHub repository: http://github.com/MischaTheEvil/projects_tree_view/tree/master +URL of the GitHub repository: http://github.com/dubcanada/projects_tree_view/master The source of this plugin can be "cloned" from the GitHub-repo using: -$ cd {RAILS_ROOT}/vendor/plugins && git clone git://github.com/MischaTheEvil/projects_tree_view.git +$ cd {RAILS_ROOT}/vendor/plugins && git://github.com/dubcanada/projects_tree_view.git ==Installation From 81f1f443a71d92145d121b381b79e2de3abe8cad Mon Sep 17 00:00:00 2001 From: Steven Verbeek Date: Thu, 1 Dec 2011 11:01:26 -0400 Subject: [PATCH 9/9] Removed excess .DS_Store files --- app/views/projects/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/views/projects/.DS_Store diff --git a/app/views/projects/.DS_Store b/app/views/projects/.DS_Store deleted file mode 100644 index ae15afe4f3ce70fb1c0a8d979e0a3733b86062c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%Sr=55Ukc5q5;X#oAU*Nf3Sr0kn>&zB_^P-x)2pT?x*=@TKzDXxZXrWx?#FH z(_J&W1)13fAhW0C888Jf=1>$3227_1Q+rXoPZV3D!6Q1Xv6{C73;o3@ef9&KqDF&D zj?MFT*Ne7WFiUCVm3Z=I#t4|;7WY_Ug%@(yxFPQj?Y#ZW!o?2j5D%>E@ccbTj&?Y@ zTUsiR3Zw$5Kq~N)3h>TW8&4e5rvj-!DzH&N&xgXHSOxZuc688L3qTxk+KjRG63Quo zRbcPP3{9L$bgD#)Ax`IfiMlGVcXT==nh%McKbjY@-MN0Ta!BQvJ{3p>wiVFcmp0Y= z|D1oB!6x5I(xn2az<*UhMs-uq_;zu(etA#5YYWE}hnm*)8qgSTeFX4_o+HPW^nB5n YbyZ;RsH^C_(TVvXV1lGe1%5$+cc7m(0{{R3