From 9cc894276da768ed5273635dbaa268ad8e112aa2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Mon, 15 Jul 2013 18:57:08 +0200 Subject: [PATCH] SONAR-4466 Provision the logical key in the model objects used by the views --- .../src/main/resources/org/sonar/l10n/core.properties | 1 + .../main/webapp/WEB-INF/app/controllers/roles_controller.rb | 4 ++-- .../WEB-INF/app/views/roles/_apply_template_form.html.erb | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index 405e144c325..e6e567d880d 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -2257,6 +2257,7 @@ projects_role.user.desc=Ability to browse the measures and to create/edit issues projects_role.codeviewer=Role: Code Viewers projects_role.codeviewer.desc=Ability to view the source code of the project. projects_role.apply_template=Apply permission template +projects_role.apply_template.form.title=Apply permission template #------------------------------------------------------------------------------ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb index e6c9b3a947c..df7403e2f32 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb @@ -69,7 +69,7 @@ class RolesController < ApplicationController def apply_template_form bad_request('There are currently no results to apply the permission template to') if params[:projects].blank? - @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().collect {|pt| [pt.name, pt.id]} + @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().collect {|pt| [pt.name, pt.key]} render :partial => 'apply_template_form', :locals => {:components => params[:projects], :qualifier => params[:qualifier] || 'TRK'} end @@ -105,7 +105,7 @@ class RolesController < ApplicationController def apply_template verify_post_request - require_parameters :template_id + require_parameters :template_key Internal.permissions.applyPermissionTemplate(params) redirect_to :action => 'projects' end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb index 7a91d6590df..4f76e4f9519 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb @@ -2,13 +2,13 @@