]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4466 Provision the logical key in the model objects used by the views
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Mon, 15 Jul 2013 16:57:08 +0000 (18:57 +0200)
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Mon, 15 Jul 2013 16:57:08 +0000 (18:57 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb

index 405e144c325b5c36a0d8b6de782b029948ab1831..e6e567d880d393b8d6141b7658db9323c4206cef 100644 (file)
@@ -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
 
 
 #------------------------------------------------------------------------------
index e6c9b3a947ca5853eaa93843d3c7781b84282ecb..df7403e2f323d734b71537a5ef8f3a0a7288c409 100644 (file)
@@ -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
index 7a91d6590dfe87ab1e418f0cf5e3763236c62612..4f76e4f951987b61c746f8d88b7f60bbfe83328b 100644 (file)
@@ -2,13 +2,13 @@
   <input type="hidden" name="components" id="apply-template-components" value="<%= components.join(',') %>"/>
   <fieldset>
     <div class="modal-head">
-      <h2><%= message('roles.apply_template.form.title', {:params => ''}) -%></h2>
+      <h2><%= message('projects_role.apply_template.form.title', {:params => ''}) -%></h2>
     </div>
     <div class="modal-body">
       <div class="apply-template errors error" style="display:none;"/>
       <div class="modal-field">
         <span><%= "Select the template to apply to #{components.size} #{message('qualifier.' + qualifier)}(s):" %></span><br/>
-        <%= select_tag('template_id', options_for_select(@permission_templates, -1)) %>
+        <%= select_tag('template_key', options_for_select(@permission_templates, -1)) %>
       </div>
     </div>
     <div class="modal-foot">