summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-04-18 02:07:44 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-04-18 02:07:44 +0000
commitba11020fdf59888d0bdb6c7208daa1a2b0a3bb50 (patch)
tree8ed5fafdcdba52d48944eebfdae8091ad6b37ecd /app
parent1bdd37f3e05611b3e69ac590cf419f3c2f109b39 (diff)
downloadredmine-ba11020fdf59888d0bdb6c7208daa1a2b0a3bb50.tar.gz
redmine-ba11020fdf59888d0bdb6c7208daa1a2b0a3bb50.zip
make height of "Commits per author" graph flexible (#1983, #13486)
Contributed by Max Horn. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11723 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/repositories_controller.rb2
-rw-r--r--app/views/repositories/stats.html.erb12
2 files changed, 11 insertions, 3 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index a757df154..2912b72bf 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -411,7 +411,7 @@ class RepositoriesController < ApplicationController
fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') }
graph = SVG::Graph::BarHorizontal.new(
- :height => 400,
+ :height => 15 * commits_data.length,
:width => 800,
:fields => fields,
:stack => :side,
diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb
index b9a5d7d6a..5c20f0585 100644
--- a/app/views/repositories/stats.html.erb
+++ b/app/views/repositories/stats.html.erb
@@ -1,10 +1,18 @@
<h2><%= l(:label_statistics) %></h2>
<p>
-<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_month")) %>
+<%= tag("embed", :width => 800, :height => params[:height_commits_per_month],
+ :type => "image/svg+xml", :src => url_for(:controller => 'repositories',
+ :action => 'graph', :id => @project,
+ :repository_id => @repository.identifier_param,
+ :graph => "commits_per_month")) %>
</p>
<p>
-<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "commits_per_author")) %>
+<%= tag("embed", :width => 800, :height => params[:height_commits_per_author],
+ :type => "image/svg+xml", :src => url_for(:controller => 'repositories',
+ :action => 'graph', :id => @project,
+ :repository_id => @repository.identifier_param,
+ :graph => "commits_per_author")) %>
</p>
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>