diff options
author | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-07-17 09:54:36 +0200 |
---|---|---|
committer | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-07-17 09:54:36 +0200 |
commit | a8a489d5da78514bb3c6bcb7ea170786a8da27cf (patch) | |
tree | 5f54da711c18cee57dae5c59ce86bf4b519469ef | |
parent | 28a46d52008dc14dc7593a6779afe6a6ce4e5482 (diff) | |
download | sonarqube-a8a489d5da78514bb3c6bcb7ea170786a8da27cf.tar.gz sonarqube-a8a489d5da78514bb3c6bcb7ea170786a8da27cf.zip |
SONAR-4453 Adjusted labels and presentation for bulk permission changes
4 files changed, 23 insertions, 10 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 54e5ec46026..7887d6ab388 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,8 +2257,10 @@ projects_role.user=Users projects_role.user.desc=Ability to browse the measures and to create/edit issues on the project. projects_role.codeviewer=Code Viewers projects_role.codeviewer.desc=Ability to view the source code of the project. -projects_role.apply_template=Apply permission template +projects_role.bulk_change=Bulk Change projects_role.apply_template.form.title=Apply permission template +projects_role.no_projects=There are currently no results to apply the permission template to. + #------------------------------------------------------------------------------ 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 b0eb5c091d4..5fb870f2d37 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 @@ -77,7 +77,6 @@ class RolesController < ApplicationController # GET /roles/apply_template_form?projects=<projects>&qualifier=<qualifier> 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.key]} render :partial => 'apply_template_form', :locals => {:components => params[:projects], :qualifier => params[:qualifier] || 'TRK'} 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 4f76e4f9519..659ff4d47ef 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 @@ -1,19 +1,31 @@ <form id="apply-template-form" method="post" action="<%= ApplicationController.root_context -%>/roles/apply_template"> - <input type="hidden" name="components" id="apply-template-components" value="<%= components.join(',') %>"/> + <% unless components.nil? %> + <input type="hidden" name="components" id="apply-template-components" value="<%= components.join(',') %>"/> + <% end %> <fieldset> <div class="modal-head"> <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_key', options_for_select(@permission_templates, -1)) %> - </div> + <% if components.nil? %> + <div class="info"> + <img src="<%= ApplicationController.root_context -%>/images/information.png" style="vertical-align: text-bottom"/> + <%= message 'projects_role.no_projects' -%> + </div> + <% else %> + <div class="modal-field"> + <%= label_tag 'template_key', 'Permission template:' %> + <%= select_tag('template_key', options_for_select(@permission_templates, -1), :style => 'width: 250px;') %> + <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}(s)" %>)</span><br/> + </div> + <% end %> </div> <div class="modal-foot"> - <span id="apply-template-loading-image" class="hidden"><%= image_tag 'loading.gif' %></span> - <input type="submit" value="<%= message('apply') -%>" id="apply-template-submit" class="apply-template" onclick="return displayLoadingImage()" /> + <% unless components.nil? %> + <span id="apply-template-loading-image" class="hidden"><%= image_tag 'loading.gif' %></span> + <input type="submit" value="<%= message('apply') -%>" id="apply-template-submit" class="apply-template" onclick="return displayLoadingImage()" /> + <% end %> <a href="#" onclick="return closeModalWindow()" id="apply-template-cancel"><%= message('cancel') -%></a> </div> </fieldset> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb index 8fc851b830b..5eab3af0fb9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb @@ -31,7 +31,7 @@ <div id="project-roles-operations" style="float: right;"> <ul class="operations"> <li class="last"> - <%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :projects => @projects.collect {|proj| proj.id}, :qualifier => @qualifier}, + <%= link_to message('projects_role.bulk_change'), {:action => :apply_template_form, :projects => @projects.collect {|proj| proj.id}, :qualifier => @qualifier}, :id => 'apply-template-modal', :class => 'open-modal link-action' %> </li> </ul> |