From edb51fb483da0dbf2dfa8853265f81b65a4efd3a Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Fri, 6 Mar 2009 13:28:54 -0800 Subject: [PATCH] Adding "View all issues" links, although the created_on one doesn't work as the field doesn't display by default. Hrm. --- app/views/graphs/old_issues.html.erb | 30 ++++++++++++++++++++------- assets/stylesheets/target_version.css | 2 ++ lib/target_version_graph_hook.rb | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/views/graphs/old_issues.html.erb b/app/views/graphs/old_issues.html.erb index 359ed27..c02eca7 100755 --- a/app/views/graphs/old_issues.html.erb +++ b/app/views/graphs/old_issues.html.erb @@ -3,17 +3,31 @@ <%= tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'issue_age_graph', :project_id => @project.id)) unless @project.nil? %>
-
-

<%= l(:label_issues_by, :value => l(:field_created_on)) %>

- <%= render :partial => 'issues/list_simple', :locals => { :issues => @issues_by_created_on[0..9] } %> -
+

<%= l(:label_issues_by, :value => l(:field_created_on)) %>

+ <%= render :partial => 'issues/list_simple', :locals => { :issues => @issues_by_created_on[0..9] } %> + <% if @issues_by_created_on.length > 0 %> +

+ <% + link_params = { :controller => :issues, :action => :index, :set_filter => 1, :sort_key => :created_on, :sort_order => :desc } + link_params[:project_id] = @project unless @project.nil? + %> + <%= link_to l(:label_issue_view_all), link_params %> +

+ <% end %>
-
-

<%= l(:label_issues_by, :value => l(:field_updated_on)) %>

- <%= render :partial => 'issues/list_simple', :locals => { :issues => @issues_by_updated_on[0..9] } %> -
+

<%= l(:label_issues_by, :value => l(:field_updated_on)) %>

+ <%= render :partial => 'issues/list_simple', :locals => { :issues => @issues_by_updated_on[0..9] } %> + <% if @issues_by_updated_on.length > 0 %> +

+ <% + link_params = { :controller => :issues, :action => :index, :set_filter => 1, :sort_key => :updated_on, :sort_order => :desc } + link_params[:project_id] = @project unless @project.nil? + %> + <%= link_to l(:label_issue_view_all), link_params %> +

+ <% end %>
<% content_for :sidebar do %> diff --git a/assets/stylesheets/target_version.css b/assets/stylesheets/target_version.css index db2775d..e1421aa 100755 --- a/assets/stylesheets/target_version.css +++ b/assets/stylesheets/target_version.css @@ -1,3 +1,5 @@ +#target_version_graph { clear: both; } + .fill1 { fill: #666 !important; } .line1 { stroke: #666 !important; } .key1, .dataPoint1 { fill: #666 !important; } diff --git a/lib/target_version_graph_hook.rb b/lib/target_version_graph_hook.rb index 5b4e6b1..74130be 100755 --- a/lib/target_version_graph_hook.rb +++ b/lib/target_version_graph_hook.rb @@ -2,7 +2,7 @@ class TargetVersionGraphHook < Redmine::Hook::ViewListener def view_versions_show_bottom(context = { }) if !context[:version].fixed_issues.empty? - output = "
#{ l(:label_graphs_total_vs_closed_issues) }" + output = "
#{ l(:label_graphs_total_vs_closed_issues) }" output << tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'target_version_graph', :id => context[:version])) output << "
" return output