Skip to content

Commit

Permalink
Merge pull request #12 from chiastolite/setting_show_project_progress
Browse files Browse the repository at this point in the history
add setting 'show project progress'
  • Loading branch information
cforce committed Oct 5, 2012
2 parents 8fac1a8 + 4d1c913 commit f9403ae
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/views/projects/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
<th><%=l(:label_project)%></th>
<th><%=l(:field_description)%></th>
<th><%=l(:field_go_to)%></th>
<th><%=l(:field_versions)%></th>
<% if Setting.plugin_projects_tree_view['show_project_progress'] %>
<th><%=l(:field_versions)%></th>
<% end %>
<th><%=l(:field_created_on)%></th>
</tr>
</thead>
Expand Down Expand Up @@ -77,7 +79,9 @@
<td class="name"><%= "<span style=\"padding-left: " + (2*(ancestors.length-1)).to_s + "em;\"></span>" %><%= spanicon %><%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %><span <%= openonclick %> class="empty <%=User.current.member_of?(project) ? 'my-project' : nil%>">&nbsp</span></td>
<td <%= openonclick %> ><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %></td>
<td><%= favorite_project_modules_links(project) %></td>
<td <%= render_project_progress(project) %></td>
<% if Setting.plugin_projects_tree_view['show_project_progress'] %>
<td <%= render_project_progress(project) %></td>
<% end %>
<td align="center"><%= format_date(project.created_on) %></td>
</tr>
<% end %>
Expand Down
9 changes: 9 additions & 0 deletions app/views/settings/_project_tree_settings.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<p>
<table>
<tr>
<td><%= l(:show_progress) %></td>
<td><%= check_box_tag('settings[show_project_progress]', true, @settings['show_project_progress'])%></td>
</tr>
</table>
</p>

1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ en:
field_go_to: Go to module
subprojects: sub projects
expand_all: "Expand All"
show_progress: "Show project progress"
4 changes: 4 additions & 0 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
author 'Chris Peterson and github contributors'
description 'This is a Redmine plugin which will turn the projects page into a tree view'
version '0.0.5'

settings :default => {
'show_project_progress' => true
}, :partial => 'settings/project_tree_settings'
end

class ProjectsTreeViewListener < Redmine::Hook::ViewListener
Expand Down

0 comments on commit f9403ae

Please sign in to comment.