diff --git a/CHANGELOG b/CHANGELOG index b443628..ec6f2f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/README.rdoc b/README.rdoc index 8c86841..2894ca3 100644 --- a/README.rdoc +++ b/README.rdoc @@ -18,7 +18,7 @@ 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.7. +The currently available, latest stable release of the plugin is version 0.0.8. ==Compatibility diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index b54ef42..b714ab2 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -15,8 +15,12 @@ <%=l(:label_project)%> <%=l(:field_description)%> - <%=l(:field_go_to)%> - <%=l(:field_versions)%> + <% if Setting.plugin_projects_tree_view['show_available_modules'].present? %> + <%= l(:field_go_to)%> + <% end %> + <% if Setting.plugin_projects_tree_view['show_project_progress'] %> + <%=l(:field_versions)%> + <% end %> <%=l(:field_created_on)%> @@ -84,8 +88,12 @@ <%= content_tag :span, ' '.html_safe, :onclick => openonclick, :class => "empty #{User.current.member_of?(project) ? 'my-project' : nil}"%> <%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %><% end -%> - <%= favorite_project_modules_links(project) %> - <%= render_project_progress(project) %> + <% if Setting.plugin_projects_tree_view['show_available_modules'].present? %> + <%= favorite_project_modules_links(project) %> + <% end %> + <% if Setting.plugin_projects_tree_view['show_project_progress'] %> + + <% end %> <%= format_date(project.created_on) %> <% end -%> <% end %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb new file mode 100644 index 0000000..79cbf40 --- /dev/null +++ b/app/views/projects/show.html.erb @@ -0,0 +1,156 @@ +
+ <% 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 %> +
+ +

<%=l(:label_overview)%>

+ +<% unless @project.active? %> +

<%= l(:text_project_closed) %>

+<% end %> + +
+ <% if @project.description.present? %> +
+ <%= textilizable @project.description %> +
+ <% end %> + <% if @subprojects.any? %> +
+ + + + + + + + + <% 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 -%> + + <%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.parent.short_description.gsub(/\!.+\!/,""), :project => project.parent %><% end -%> + + <% 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 -%> + + <%= content_tag :td, :onclick => openonclick do -%><%= textilizable project.short_description.gsub(/\!.+\!/,""), :project => project %><% end -%> + <% end -%> + <% end %> + +
<%=l(:label_project)%><%=l(:field_description)%>
+ <%= content_tag(:span, "  ".html_safe, :onclick => openonclick, :class => "expander") %> + <%= h(project.parent.name)%> + <%= content_tag(:span, "  ".html_safe, :onclick => openonclick, :class => "empty") %> + + <%= 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, ' '.html_safe, :onclick => openonclick, :class => "empty #{User.current.member_of?(project) ? 'my-project' : nil}"%> +
+
+ <% end %> + + + <%= call_hook(:view_projects_show_left, :project => @project) %> +
+ +
+ <% if User.current.allowed_to?(:view_issues, @project) %> +
+

<%=l(:label_issue_tracking)%>

+ +

+ <%= 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 %> +

+
+ <% end %> + + + <%= render :partial => 'members_box' %> + + <% if @news.any? && authorize_for('news', 'index') %> +
+

<%=l(:label_news_latest)%>

+ <%= render :partial => 'news/news', :collection => @news %> +

<%= link_to l(:label_news_view_all), project_news_index_path(@project) %>

+
+ <% end %> + <%= call_hook(:view_projects_show_right, :project => @project) %> +
+ +<% content_for :sidebar do %> + <% if @total_hours.present? %> +

<%= l(:label_spent_time) %>

+

<%= l_hours(@total_hours) %>

+

+ <% 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)) %>

+ <% 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)) -%> diff --git a/app/views/settings/_project_tree_settings.html.erb b/app/views/settings/_project_tree_settings.html.erb new file mode 100644 index 0000000..c4a6d3c --- /dev/null +++ b/app/views/settings/_project_tree_settings.html.erb @@ -0,0 +1,12 @@ +

+ + + + + + + + + +
<%= l(:show_progress) %><%= check_box_tag('settings[show_project_progress]', true, @settings['show_project_progress'])%>
<%= l(:show_modules) %><%= check_box_tag('settings[show_available_modules]', true, @settings['show_available_modules'])%>
+

diff --git a/config/locales/de.yml b/config/locales/de.yml index 2e11903..a881a1b 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,6 +1,9 @@ -de: +de: # German strings go here field_versions: Versionen field_go_to: zu einem Modul wechseln - subprojects: Untergeordnete Bereiche \ No newline at end of file + subprojects: Untergeordnete Bereiche + show_progress: "Projektfortschritt anzeigen" + show_modules: "Module in Projektübersichtsliste anzeigen" + \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 04710ce..2569db5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 399b1e0..f23cffb 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -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" diff --git a/init.rb b/init.rb index 835253c..40daa95 100644 --- a/init.rb +++ b/init.rb @@ -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 diff --git a/lib/projects_tree_view/patches/projects_helper.rb b/lib/projects_tree_view/patches/projects_helper.rb index 39c6c5a..735706b 100644 --- a/lib/projects_tree_view/patches/projects_helper.rb +++ b/lib/projects_tree_view/patches/projects_helper.rb @@ -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) { " / ".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) +