From d5a7c1a09df34cbeb34eb9857ec2bba74b6161c8 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Tue, 7 Apr 2009 16:31:43 -0700 Subject: [PATCH] Working on a way of showing flow --- app/controllers/graphs_controller.rb | 2 +- app/views/graphs/issue_status_flow.html.erb | 26 ++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/controllers/graphs_controller.rb b/app/controllers/graphs_controller.rb index a7a5f74..a4507ea 100755 --- a/app/controllers/graphs_controller.rb +++ b/app/controllers/graphs_controller.rb @@ -17,7 +17,7 @@ class GraphsController < ApplicationController sql << " left join journal_details as jd on j.id = jd.journal_id" sql << " left join issue_statuses as is1 on jd.old_value = is1.id" sql << " left join issue_statuses as is2 on jd.value = is2.id" - sql << " where journalized_type = 'issue' and prop_key = 'status_id' and DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 10 DAY) <= created_on" + sql << " where journalized_type = 'issue' and prop_key = 'status_id' and DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 15 DAY) <= created_on" sql << " group by old_value, value" sql << " order by is1.position, is2.position" @status_changes = ActiveRecord::Base.connection.select_all(sql) diff --git a/app/views/graphs/issue_status_flow.html.erb b/app/views/graphs/issue_status_flow.html.erb index dc8ae04..de4966c 100644 --- a/app/views/graphs/issue_status_flow.html.erb +++ b/app/views/graphs/issue_status_flow.html.erb @@ -13,14 +13,24 @@ %> - + <% @status_changes.each do |status_change| %> - " - x2="<%= points[status_change["old_status"].to_i]["x"] %>" - y1="<%= points[status_change["new_status"].to_i]["y"] %>" - x1="<%= points[status_change["new_status"].to_i]["x"] %>" - stroke-width="<%= status_change["changes_count"].to_i %>" + <% + changes_count = status_change["changes_count"].to_i + + x1 = points[status_change["old_status"].to_i]["x"] + y1 = points[status_change["old_status"].to_i]["y"] + + x2 = points[status_change["new_status"].to_i]["x"] + y2 = points[status_change["new_status"].to_i]["y"] + + x1a = x1 # f(changes_count) + y1a = y1 # f(changes_count) + x1b = x1 # f(changes_count) + y1b = y1 # f(changes_count) + %> + <% end %> @@ -29,7 +39,7 @@ " cy="<%= point["y"] %>" r="40" /> <% end %> - + <% points.each do |status_id, point| %> " y="<%= point["y"] %>"><%= issue_statuses_by_id[status_id] %> <% end %>