diff --git a/app/controllers/graphs_controller.rb b/app/controllers/graphs_controller.rb index c0adc9d..d146d80 100644 --- a/app/controllers/graphs_controller.rb +++ b/app/controllers/graphs_controller.rb @@ -10,7 +10,7 @@ class GraphsController < ApplicationController helper IssuesHelper - def issue_status_flow + def issue_status_flow_graph # Get the top visible projects by issue count sql = " select is1.id as old_status, is2.id as new_status, count(*) as changes_count" sql << " from journals as j" diff --git a/app/views/graphs/issue_status_flow.html.erb b/app/views/graphs/issue_status_flow_graph.html.erb similarity index 84% rename from app/views/graphs/issue_status_flow.html.erb rename to app/views/graphs/issue_status_flow_graph.html.erb index 0783ec0..89183bc 100644 --- a/app/views/graphs/issue_status_flow.html.erb +++ b/app/views/graphs/issue_status_flow_graph.html.erb @@ -7,12 +7,15 @@ points = Hash.new i = -1 @issue_statuses.each do |issue_status| - points[issue_status.id] = {"x" => Math.sin(2*Math::PI*i/@issue_statuses.size)*100 + 150, "y" => Math.cos(2*Math::PI*i/@issue_statuses.size)*100 + 150} + points[issue_status.id] = { + "x" => Math.sin(2*Math::PI*i/@issue_statuses.size)*100 + 140, + "y" => Math.cos(2*Math::PI*i/@issue_statuses.size)*100 + 125 + } i -= 1 end %> - + <% @status_changes.each do |status_change| %> <% @@ -41,7 +44,7 @@ /> <% end %> - + <% points.each do |status_id, point| %> " cy="<%= point["y"] %>" r="35" /> <% end %> diff --git a/app/views/my/blocks/_issue_status_flow.html.erb b/app/views/my/blocks/_issue_status_flow.html.erb new file mode 100644 index 0000000..95a85cc --- /dev/null +++ b/app/views/my/blocks/_issue_status_flow.html.erb @@ -0,0 +1,5 @@ +

<%= l(:label_graphs_issue_status_flow) %>

+ +
+<%= tag("embed", :width => "300", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'issue_status_flow_graph')) %> +
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 857656f..591a202 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,4 +3,4 @@ en: label_graphs_total_vs_closed_issues: Total issues vs. Closed issues label_graphs_old_issues: Open aging issues label_graphs_issue_growth: Total issues over time - + label_graphs_issue_status_flow: Recent status changes (within 24 hours)