aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-12-16 17:03:13 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2011-12-16 17:03:13 +0100
commit8c6e23469be5e7b675b95c9e98c6b6b21d4f7a3d (patch)
tree882a284f0882551f4aa08d0881838754e74a8d78
parenta995e4845586ad2acfb8451083daf66de17c3868 (diff)
downloadsonarqube-8c6e23469be5e7b675b95c9e98c6b6b21d4f7a3d.tar.gz
sonarqube-8c6e23469be5e7b675b95c9e98c6b6b21d4f7a3d.zip
Minor refactoring on ruby variable names
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb7
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb4
2 files changed, 7 insertions, 4 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 5f56517a2b7..aa37b23de42 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
@@ -137,6 +137,9 @@ class DashboardController < ApplicationController
render :partial => 'dashboard/widget_definitions', :locals => {:dashboard_id => params[:did], :resource_id => params[:id], :filter_on_category => params[:category]}
end
+
+
+
private
def load_dashboard
@@ -175,8 +178,8 @@ class DashboardController < ApplicationController
def load_authorized_widget_definitions
if @resource
- @widget_definitions = java_facade.getWidgets(@resource.scope, @resource.qualifier, @resource.language)
- @widget_definitions=@widget_definitions.select do |widget|
+ @authorized_widget_definitions = java_facade.getWidgets(@resource.scope, @resource.qualifier, @resource.language)
+ @authorized_widget_definitions=@authorized_widget_definitions.select do |widget|
authorized=widget.getUserRoles().size==0
unless authorized
widget.getUserRoles().each do |role|
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb
index 74536f71631..b40d14c6f1d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb
@@ -10,11 +10,11 @@
<div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0 <%= index<columns.size() ? "5px" : "0px" -%> 0 <%= index>1 ? "5px" : "0px" -%>;">
<%
@dashboard.widgets.select { |widget| widget.column_index==index }.sort_by { |widget| widget.row_index }.each do |widget|
- widget_definition=@widget_definitions.find { |wd| wd.getId()==widget.widget_key }
+ widget_definition=@authorized_widget_definitions.find { |wd| wd.getId()==widget.widget_key }
if widget_definition
%>
<div class="block" id="block_<%= widget.id -%>">
- <%= render :partial => 'dashboard/widget', :locals => {:widget => widget, :definition => widget_definition} %>
+ <%= render :partial => 'dashboard/widget', :locals => {:widget => widget} %>
</div>
<%
end