Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.0.8 (2015-01-19):
* Support for Redmine 2.6.1
* Added feature to disable progress bar on project tab
* Layout fixes
0.0.7 (2012-06-16):
* UI updated to prevent the continual need for html_safe declarations
* second commit for 0.0.7 due to error in init.rb
Expand Down
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For the complete changelog see the <tt>CHANGELOG</tt>-file in the Projects Tree

==Latest stable release

The currently available, latest stable release of the plugin is version <b>0.0.7</b>.
The currently available, latest stable release of the plugin is version <b>0.0.8</b>.

==Compatibility

Expand Down
16 changes: 12 additions & 4 deletions app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
<tr>
<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_available_modules'].present? %>
<th><%= l(:field_go_to)%></th>
<% end %>
<% 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 @@ -84,8 +88,12 @@
<%= content_tag :span, '&nbsp;'.html_safe, :onclick => openonclick, :class => "empty #{User.current.member_of?(project) ? 'my-project' : nil}"%>
</td>
<%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %><% end -%>
<td><%= favorite_project_modules_links(project) %></td>
<td><%= render_project_progress(project) %></td>
<% if Setting.plugin_projects_tree_view['show_available_modules'].present? %>
<td><%= favorite_project_modules_links(project) %></td>
<% end %>
<% 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>
<% end -%>
<% end %>
Expand Down
156 changes: 156 additions & 0 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<div class="contextual">
<% if User.current.allowed_to?(:add_subprojects, @project) %>
<%= link_to l(:label_subproject_new), new_project_path(:parent_id => @project), :class => 'icon icon-add' %>
<% end %>
<% if User.current.allowed_to?(:close_project, @project) %>
<% if @project.active? %>
<%= link_to l(:button_close), close_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock' %>
<% else %>
<%= link_to l(:button_reopen), reopen_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-unlock' %>
<% end %>
<% end %>
</div>

<h2><%=l(:label_overview)%></h2>

<% unless @project.active? %>
<p class="warning"><span class="icon icon-lock"><%= l(:text_project_closed) %></span></p>
<% end %>

<div class="splitcontentleft">
<% if @project.description.present? %>
<div class="wiki">
<%= textilizable @project.description %>
</div>
<% end %>
<% if @subprojects.any? %>
<div class="issues box">
<table class="list">
<thead>
<tr>
<th><%=l(:label_project)%></th>
<th><%=l(:field_description)%></th>
</tr>
</thead>
<tbody>
<% ancestors = [] %>
<% for project in @subprojects %>
<% rowid = "" %>
<% classes = " child" %>
<% spanicon = "" %>
<% openonclick = "" %>
<% showchildren = true %>
<% if(project.parent_id == nil) %>
<% ancestors.clear %>
<% ancestors << project.id %>
<% else %>
<% while (ancestors.any? && !(project.parent_id == ancestors.last)) %>
<% ancestors.pop %>
<% end %>
<% if( !(ancestors.detect {|pid| pid == project.parent_id })) %>
<% prvclasses = "open show parent " + cycle("odd", "even") %>
<% ancestors.each do |pid| %>
<% prvclasses += " " + "%04d" % pid %>
<% end %>
<% project_parent_id_lsd = "%04d" % project.parent.id %>
<% openonclick = "showHide('"+project_parent_id_lsd+"','"+project_parent_id_lsd+"span')".html_safe %>
<%= content_tag :tr, :id => project_parent_id_lsd + "span", :class => prvclasses do -%>
<td class="name" >
<%= content_tag(:span, "&nbsp; ".html_safe, :onclick => openonclick, :class => "expander") %>
<%= h(project.parent.name)%>
<%= content_tag(:span, "&nbsp; ".html_safe, :onclick => openonclick, :class => "empty") %>
</td>
<%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.parent.short_description.gsub(/\!.+\!/,""), :project => project.parent %><% end -%>
</span>
<% end -%>
<% ancestors << project.parent_id %>
<% end %>
<% ancestors.each do |pid| %>
<% classes += " " + "%04d" % pid %>
<% end %>
<% ancestors << project.id %>
<% end %>
<%= content_tag :tr, :class => classes, :id => rowid do -%>
<td class="name">
<%= content_tag :span, '', :style => "padding-left: #{(2*(ancestors.length-1)).to_s}em;" %>
<%= spanicon %>
<%= project.active? ? link_to(h(project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "project") : h(project.name) %>
<%= content_tag :span, '&nbsp;'.html_safe, :onclick => openonclick, :class => "empty #{User.current.member_of?(project) ? 'my-project' : nil}"%>
</td>
<%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %><% end -%>
<% end -%>
<% end %>
</tbody>
</table>
</div>
<% end %>

<ul>
<% unless @project.homepage.blank? %>
<li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @project.homepage %></li>
<% end %>
<% @project.visible_custom_field_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
<li><%=h custom_value.custom_field.name %>: <%=h show_value(custom_value) %></li>
<% end %>
<% end %>
</ul>
<%= call_hook(:view_projects_show_left, :project => @project) %>
</div>

<div class="splitcontentright">
<% if User.current.allowed_to?(:view_issues, @project) %>
<div class="issues box">
<h3><%=l(:label_issue_tracking)%></h3>
<ul>
<% for tracker in @trackers %>
<li><%= link_to h(tracker.name), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>:
<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
:total => @total_issues_by_tracker[tracker].to_i) %>
</li>
<% end %>
</ul>
<p>
<%= link_to l(:label_issue_view_all), project_issues_path(@project, :set_filter => 1) %>
<% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
| <%= link_to l(:label_calendar), project_calendar_path(@project) %>
<% end %>
<% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
| <%= link_to l(:label_gantt), project_gantt_path(@project) %>
<% end %>
</p>
</div>
<% end %>


<%= render :partial => 'members_box' %>

<% if @news.any? && authorize_for('news', 'index') %>
<div class="news box">
<h3><%=l(:label_news_latest)%></h3>
<%= render :partial => 'news/news', :collection => @news %>
<p><%= link_to l(:label_news_view_all), project_news_index_path(@project) %></p>
</div>
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div>

<% content_for :sidebar do %>
<% if @total_hours.present? %>
<h3><%= l(:label_spent_time) %></h3>
<p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p>
<p>
<% if User.current.allowed_to?(:log_time, @project) %>
<%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> |
<% end %>
<%= link_to(l(:label_details), project_time_entries_path(@project)) %> |
<%= link_to(l(:label_report), report_project_time_entries_path(@project)) %></p>
<% end %>
<%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
<% end %>

<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
<% end %>

<% html_title(l(:label_overview)) -%>
12 changes: 12 additions & 0 deletions app/views/settings/_project_tree_settings.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<p>
<table>
<tr>
<td><%= l(:show_progress) %></td>
<td><%= check_box_tag('settings[show_project_progress]', true, @settings['show_project_progress'])%></td>
</tr>
<tr>
<td><%= l(:show_modules) %></td>
<td><%= check_box_tag('settings[show_available_modules]', true, @settings['show_available_modules'])%></td>
</tr>
</table>
</p>
7 changes: 5 additions & 2 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
de:
de:
# German strings go here

field_versions: Versionen
field_go_to: zu einem Modul wechseln
subprojects: Untergeordnete Bereiche
subprojects: Untergeordnete Bereiche
show_progress: "Projektfortschritt anzeigen"
show_modules: "Module in Projektübersichtsliste anzeigen"

2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ en:
field_go_to: Go to module
subprojects: sub projects
expand_all: "Expand All"
show_progress: "Show project progress"
show_modules: "Show module list"
2 changes: 2 additions & 0 deletions config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ pt-BR:
field_go_to: "Ir para módulo"
subprojects: "Sub-projetos"
expand_all: "Expandir todos os projetos"
show_progress: "Show project progress"
show_modules: "Show module list"
8 changes: 6 additions & 2 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

Redmine::Plugin.register :projects_tree_view do
name 'Projects Tree View plugin'
author 'Chris Peterson and Github community'
author 'Github community'
description 'This is a Redmine plugin which will turn the projects page into a tree view'
version '0.0.7'
url 'https://github.com/fishermans/projects_tree_view'
version '0.0.8'
settings :default => {
'show_project_progress' => true
}, :partial => 'settings/project_tree_settings'
end

class ProjectsTreeViewListener < Redmine::Hook::ViewListener
Expand Down
4 changes: 1 addition & 3 deletions lib/projects_tree_view/patches/projects_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ def render_project_progress(project)
content_tag(:div, :style => "clear:both; display: block") {
link_to_version(version) + ": ".html_safe +
link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) +
content_tag(:small) {
"&nbsp;/&nbsp;".html_safe +
link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1)
} +
link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) +
' '.html_safe + due_date_distance_in_words(version.effective_date) if version.effective_date
} +
# content_tag(:br) +
Expand Down