aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-03 12:30:45 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-03 12:30:45 +0000
commit48f63df9e3f03edaf762b32e988a24e69ca54604 (patch)
tree39c65df68a3077a21f05a5484947fd775e90a3af /sonar-server
parent4d82935705f55a8f3cfac0fa20f7c8930f5d9111 (diff)
downloadsonarqube-48f63df9e3f03edaf762b32e988a24e69ca54604.tar.gz
sonarqube-48f63df9e3f03edaf762b32e988a24e69ca54604.zip
SONAR-1643 add new widget to top left corner of dashboard instead of bottom right
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
index 293a45ff67d..bf7725dff03 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
@@ -89,12 +89,17 @@ class DashboardController < ApplicationController
if dashboard.editable_by?(current_user)
definition=java_facade.getWidget(params[:widget])
if definition
+ first_column_widgets=dashboard.widgets.select{|w| w.column_index==1}
new_widget=dashboard.widgets.create(:widget_key => definition.getId(),
:name => definition.getTitle(),
- :column_index => dashboard.number_of_columns,
- :row_index => dashboard.column_size(dashboard.number_of_columns) + 1,
+ :column_index => 1,
+ :row_index => 1,
:configured => !definition.hasRequiredProperties())
widget_id=new_widget.id
+ first_column_widgets.each_with_index do |w, index|
+ w.row_index=index+2
+ w.save
+ end
end
end
redirect_to :action => 'configure', :did => dashboard.id, :id => params[:id], :highlight => widget_id