From 5637dd8a4bac8ecc03df4da56e5112ce31d498f5 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 21 Jul 2011 17:18:05 +0200 Subject: [PATCH] SONAR-2547 fix breadcrumb of manual measures --- .../WEB-INF/app/controllers/manual_measures_controller.rb | 8 ++++---- .../webapp/WEB-INF/app/views/layouts/_layout.html.erb | 2 +- .../WEB-INF/app/views/manual_measures/index.html.erb | 6 +++--- .../webapp/WEB-INF/app/views/manual_measures/new.html.erb | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb index f2a9c564f21..255a436722a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/manual_measures_controller.rb @@ -48,22 +48,22 @@ class ManualMeasuresController < ApplicationController measure.description = params[:desc] measure.save! if (params[:redirect_to_new]=='true') - redirect_to :action => 'new', :resource => params[:resource] + redirect_to :action => 'new', :id => params[:id] else - redirect_to :action => 'index', :resource => params[:resource], :metric => params[:metric] + redirect_to :action => 'index', :id => params[:id], :metric => params[:metric] end end def delete metric=Metric.by_key(params[:metric]) ManualMeasure.destroy_all(['resource_id=? and metric_id=?', @resource.id, metric.id]) - redirect_to :action => 'index', :resource => params[:resource], :metric => params[:metric] + redirect_to :action => 'index', :id => params[:id], :metric => params[:metric] end private def load_resource - @resource=Project.by_key(params[:resource]) + @resource=Project.by_key(params[:id]) return redirect_to home_path unless @resource return access_denied unless has_role?(:admin, @resource) @snapshot=@resource.last_snapshot diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index 33aefe64b41..70f1a4f0cc7 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -50,7 +50,7 @@ <% end %> <% if has_role?(:admin, @project) %>
  • <%= message('sidebar.project_system') -%>
  • -
  • <%= message('manual_measures.page') -%>
  • +
  • <%= message('manual_measures.page') -%>
  • <% if (@project.project? || @project.module?) %>
  • <%= message('project_settings.page') -%>
  • <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb index af436a04946..0b19dcd646b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb @@ -14,7 +14,7 @@ @@ -56,8 +56,8 @@ <%= l(measure.updated_at) -%> - Edit - <%= link_to 'Delete', {:action => 'delete', :metric => measure.metric.key, :resource => @resource.id}, {:method => 'POST', :confirm => "This measure will be deleted during next project analysis", :class => 'action'} -%> + Edit + <%= link_to 'Delete', {:action => 'delete', :metric => measure.metric.key, :id => @resource.id}, {:method => 'POST', :confirm => "This measure will be deleted during next project analysis", :class => 'action'} -%> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/new.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/new.html.erb index 4dc0ef8e3bb..5492e84df4c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/new.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/new.html.erb @@ -1,6 +1,6 @@
    - + @@ -69,7 +69,7 @@ <% end %> - <%= link_to 'Cancel', :action => 'index', :resource => @resource.key -%> + <%= link_to 'Cancel', :action => 'index', :id => @resource.id -%> -- 2.39.5