diff options
author | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-07-15 18:57:08 +0200 |
---|---|---|
committer | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-07-15 18:57:08 +0200 |
commit | 9cc894276da768ed5273635dbaa268ad8e112aa2 (patch) | |
tree | e783d42011665abfd7cb8bde99cf09e428724ed3 | |
parent | fc80b8c4bbfc89314c99e2817d1fed5b8123a3e2 (diff) | |
download | sonarqube-9cc894276da768ed5273635dbaa268ad8e112aa2.tar.gz sonarqube-9cc894276da768ed5273635dbaa268ad8e112aa2.zip |
SONAR-4466 Provision the logical key in the model objects used by the views
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 @@ <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"> |