diff options
12 files changed, 165 insertions, 258 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 e6e567d880d..8badcd35be4 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 @@ -2242,7 +2242,7 @@ global_permissions.dryRunScan.desc=Ability to execute local (dry run) analyses w #------------------------------------------------------------------------------ # -# PROJECTS ROLES +# PROJECTS PERMISSIONS # #------------------------------------------------------------------------------ projects_role.criteria.name=Name contains @@ -2250,11 +2250,11 @@ projects_role.criteria.key=Key contains projects_role.role=Role Membership For New projects_role.users=Users projects_role.groups=Groups -projects_role.admin=Role: Administrators +projects_role.admin=Administrators projects_role.admin.desc=Ability to perform administration tasks for the project by accessing its settings. -projects_role.user=Role: Users +projects_role.user=Users projects_role.user.desc=Ability to browse the measures and to create/edit issues on the project. -projects_role.codeviewer=Role: Code Viewers +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.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 df7403e2f32..a7b55db8ebc 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 @@ -50,21 +50,13 @@ class RolesController < ApplicationController def edit_users @project=Project.by_key(params[:resource]) if params[:resource].present? @role = params[:role] + render :partial => 'edit_users' end def edit_groups @project=Project.by_key(params[:resource]) if params[:resource].present? @role = params[:role] - end - - def edit_default_project_groups - bad_request('Missing role') if params[:role].blank? - bad_request('Missing qualifier') if params[:qualifier].blank? - end - - def edit_default_project_users - bad_request('Missing role') if params[:role].blank? - bad_request('Missing qualifier') if params[:qualifier].blank? + render :partial => 'edit_groups' end def apply_template_form @@ -78,7 +70,7 @@ class RolesController < ApplicationController def set_users bad_request('Missing role') if params[:role].blank? UserRole.grant_users(params[:users], params[:role], params[:resource]) - redirect + render :text => '', :status => 200 end def set_groups diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_groups.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_groups.html.erb index a5d0a387401..fce1c839136 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_groups.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_groups.html.erb @@ -4,9 +4,10 @@ <input type="hidden" name="permission" value="<%= @permission -%>"/> <fieldset> <div class="modal-head"> - <h2><%= message("permission_template.edit_permissions") -%></h2> + <h2><%= message('permission_template.edit_permissions') -%></h2> </div> <div class="modal-body"> + <div id="permission-template-error" class="permission-template error" style="display:none;" /> <table> <tbody> <tr> @@ -37,7 +38,7 @@ </table> </div> <div class="modal-foot"> - <input type="submit" onclick="SelectBox.select_all('to');" value="<%= h message("permission_template.update_permissions") -%>" id="submit-permission-template-update"/> + <input type="submit" onclick="SelectBox.select_all('to');" value="<%= h message('permission_template.update_permissions') -%>" id="submit-permission-template-update"/> <a href="#" onclick="return closeModalWindow()" id="cancel-update-template"><%= h message('cancel') -%></a> </div> </fieldset> @@ -52,9 +53,9 @@ }, error: function (xhr, textStatus, errorThrown) { var htmlClass = 'permission-template'; - $j('input[id^="submit-permission-template"]').removeAttr('disabled'); - $j('.' + htmlClass + '.errors').show(); - $j('.' + htmlClass + '.errors').html(xhr.responseText); + $j('input[id="submit-permission-template-update"]').removeAttr('disabled'); + $j('.' + htmlClass + '.error').show(); + $j('.' + htmlClass + '.error').html(xhr.responseText); } }); </script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_users.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_users.html.erb index 9a2b7256cba..9125985ed90 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_users.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_users.html.erb @@ -7,6 +7,7 @@ <h2><%= message('permission_template.edit_permissions') -%></h2> </div> <div class="modal-body"> + <div id="permission-template-error" class="permission-template error" style="display:none;" /> <table> <tbody> <tr> @@ -46,15 +47,16 @@ <script> SelectBox.init('from'); SelectBox.init('to'); + $j("#permission-template-form").modalForm({ success: function (data) { window.location.reload(); }, error: function (xhr, textStatus, errorThrown) { var htmlClass = 'permission-template'; - $j('input[id^="submit-permission-template"]').removeAttr('disabled'); - $j('.' + htmlClass + '.errors').show(); - $j('.' + htmlClass + '.errors').html(xhr.responseText); + $j('input[id="submit-permission-template-update"]').removeAttr('disabled'); + $j('.' + htmlClass + '.error').show(); + $j('.' + htmlClass + '.error').html(xhr.responseText); } }); </script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_groups.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_groups.html.erb new file mode 100644 index 00000000000..d1d58d4299f --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_groups.html.erb @@ -0,0 +1,67 @@ +<% + granted_groups=groups(@role, params[:resource]) + ungranted_groups=all_groups - granted_groups +%> +<div> + <form id="permission-groups-form" action="<%= url_for :action => 'set_groups' -%>" method="post"> + <input name="resource" value="<%= params[:resource] -%>" type="hidden"/> + <input name="role" value="<%= @role -%>" type="hidden"/> + <fieldset> + <div class="modal-head"> + <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "System #{role_name(@role)}" -%></h2> + </div> + <div class="modal-body"> + <div id="permission-groups-error" class="permission-groups error" style="display:none;" /> + <table> + <tbody> + <tr> + <td style="padding: 5px 0;" valign="top"> + <h2>Add Groups</h2> + <select name="from" id="from" size="20" style="margin: 5px 0; width: 300px;" multiple="multiple"> + <% ungranted_groups.each do |group| %> + <option value="<%= group ? group.id : '' -%>"><%= group_name(group) -%></option> + <% end %> + </select> + </td> + <td style="padding: 0 10px;" align="center"> + <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> + <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> + <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> + <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> + </td> + <td class="box" style="padding: 5px 10px;" valign="top"> + <h2>Role: <%= @project ? role_name(@role) : global_role_name(@role) -%></h2> + + <select name="groups[]" id="to" size="20" multiple="multiple" style="margin: 5px 0pt; width: 300px;"> + <% granted_groups.each do |group| %> + <option value="<%= group ? group.id : '' -%>"><%= group_name(group) -%></option> + <% end %> + </select><br> + </td> + </tr> + </tbody> + </table> + </div> + <div class="modal-foot"> + <input type="submit" onclick="SelectBox.select_all('to');" value="<%= h message('save') -%>" id="submit-permission-groups-update"/> + <a href="#" onclick="return closeModalWindow()" id="cancel-update-permission-groups"><%= h message('cancel') -%></a> + </div> + </fieldset> + </form> + <script> + SelectBox.init('from'); + SelectBox.init('to'); + + $j("#permission-groups-form").modalForm({ + success: function (data) { + window.location.reload(); + }, + error: function (xhr, textStatus, errorThrown) { + var htmlClass = 'permission-groups'; + $j('input[id="submit-permission-groups-update"]').removeAttr('disabled'); + $j('.' + htmlClass + '.error').show(); + $j('.' + htmlClass + '.error').html(xhr.responseText); + } + }); + </script> +</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_users.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_users.html.erb new file mode 100644 index 00000000000..b5f8cd1b7ee --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_users.html.erb @@ -0,0 +1,64 @@ +<% + granted_users=users(@role, params[:resource]) + ungranted_users=(all_users - granted_users) +%> +<form id="permission-users-form" action="<%= url_for :action => 'set_users' -%>" method="post"> + <input name="resource" value="<%= params[:resource] -%>" type="hidden"/> + <input name="role" value="<%= @role -%>" type="hidden" /> + <fieldset> + <div class="modal-head"> + <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "System #{role_name(@role)}" -%></h2> + </div> + <div class="modal-body"> + <div id="permission-users-error" class="permission-users error" style="display:none;" /> + <table> + <tbody> + <tr> + <td style="padding: 5px 0;" valign="top"> + <h2>Add Users</h2> + <select name="from" id="from" size="30" style="margin: 5px 0; width: 300px;" multiple="multiple"> + <% ungranted_users.each do |user| %> + <option value="<%= user.id -%>"><%= user.name -%></option> + <% end %> + </select> + </td> + <td style="padding: 0 10px;" align="center"> + <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> + <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> + <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> + <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> + </td> + <td class="box" style="padding: 5px 10px;" valign="top"> + <h2>Permission: <%= @project ? role_name(@role) : global_role_name(@role) -%></h2> + + <select name="users[]" id="to" size="30" multiple="multiple" style="margin: 5px 0; width: 300px;"> + <%= options_from_collection_for_select(granted_users, "id", "name") %> + </select><br> + </td> + </tr> + </tbody> + </table> + </div> + <div class="modal-foot"> + <input type="submit" onclick="SelectBox.select_all('to');" value="<%= h message('save') -%>" id="submit-permission-users-update"/> + <a href="#" onclick="return closeModalWindow()" id="cancel-update-permission-users"><%= h message('cancel') -%></a> + </div> + </fieldset> +</form> +<script> + SelectBox.init('from'); + SelectBox.init('to'); + + $j("#permission-users-form").modalForm({ + success: function (data) { + window.location.reload(); + }, + error: function (xhr, textStatus, errorThrown) { + var htmlClass = 'permission-users'; + $j('input[id="submit-permission-users-update"]').removeAttr('disabled'); + $j('.' + htmlClass + '.error').show(); + $j('.' + htmlClass + '.error').html(xhr.responseText); + } + }); +</script> + diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_groups.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_groups.html.erb deleted file mode 100644 index 8d4a2003e2b..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_groups.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% - granted_groups=default_project_group_names(params[:role], params[:qualifier]) - all_groups = ['Anyone'].concat(Api::Utils.insensitive_sort(Group.all.map{|group| group.name})) - ungranted_groups=all_groups - granted_groups -%> -<div class="subtitle">» <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div> -<h1>Role Membership For New <%= message("qualifiers.#{params[:qualifier]}") -%></h1> -<br/> -<div> - <form action="<%= url_for :action => 'set_default_project_groups' -%>" method="POST"> - <input name="role" value="<%= params[:role] -%>" type="hidden"/> - <input name="redirect" value="projects" type="hidden"/> - <input name="q" value="<%= params[:q] -%>" type="hidden" /> - <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" /> - <input name="page" value="<%= params[:page] -%>" type="hidden" /> - <table> - <tbody> - <tr> - <td style="padding: 5px 0;" valign="top"> - <h2>Add Groups</h2> - <select name="from" id="from" size="20" style="margin: 5px 0; width: 300px;" multiple="multiple"> - <% ungranted_groups.each do |group| %> - <option value="<%= h group -%>"><%= group -%></option> - <% end %> - </select> - </td> - <td style="padding: 0 10px;" align="center"> - <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> - <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> - <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> - <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> - </td> - <td class="box" style="padding: 5px 10px;" valign="top"> - <h2>Role: <%= role_name(params[:role]) -%></h2> - - <select name="groups[]" id="to" size="20" multiple="multiple" style="margin: 5px 0; width: 300px;"> - <% granted_groups.each do |group| %> - <option value="<%= h group -%>"><%= group -%></option> - <% end %> - </select><br> - - <div style="padding: 5px 0;"> - <input id="save" value="Save" onclick="SelectBox.select_all('to');submit();return false;" type="submit"> - <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>"><%= message 'cancel' -%></a> - </div> - </td> - </tr> - </tbody> - </table> - </form> - <script> - SelectBox.init('from'); - SelectBox.init('to'); - </script> -</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_users.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_users.html.erb deleted file mode 100644 index 9108ff50d96..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_default_project_users.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -<% - granted_users=default_project_users(params[:role], params[:qualifier]) - ungranted_users=all_users - granted_users -%> -<div class="subtitle">» <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div> -<h1>Role Membership For New <%= message("qualifiers.#{params[:qualifier]}") -%></h1> -<br/> -<div> - <form action="<%= url_for :action => 'set_default_project_users' -%>" method="POST"> - <input name="role" value="<%= params[:role] -%>" type="hidden"/> - <input name="redirect" value="projects" type="hidden"/> - <input name="q" value="<%= params[:q] -%>" type="hidden" /> - <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" /> - <input name="page" value="<%= params[:page] -%>" type="hidden" /> - <table> - <tbody> - <tr> - <td style="padding: 5px 0;" valign="top"> - <h2>Add Users</h2> - <select name="from" id="from" size="20" style="margin: 5px 0; width: 300px;" multiple="multiple"> - <% ungranted_users.each do |user| %> - <option value="<%= h user.login -%>"><%= h user.name -%></option> - <% end %> - </select> - </td> - <td style="padding: 0 10px;" align="center"> - <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> - <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> - <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> - <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> - </td> - <td class="box" style="padding: 5px 10px;" valign="top"> - <h2>Role: <%= role_name(params[:role]) -%></h2> - - <select name="logins[]" id="to" size="20" multiple="multiple" style="margin: 5px 0; width: 300px;"> - <% granted_users.each do |user| %> - <option value="<%= h user.login -%>"><%= h user.name -%></option> - <% end %> - </select><br> - - <div style="padding: 5px 0;"> - <input id="save" value="Save" onclick="SelectBox.select_all('to');submit();return false;" type="submit"> - <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>"><%= message 'cancel' -%></a> - </div> - </td> - </tr> - </tbody> - </table> - </form> - <script> - SelectBox.init('from'); - SelectBox.init('to'); - </script> -</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb deleted file mode 100644 index 7a258bc5218..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_groups.html.erb +++ /dev/null @@ -1,60 +0,0 @@ -<% - granted_groups=groups(@role, params[:resource]) - ungranted_groups=all_groups - granted_groups - if @project - title='Role Membership For: ' + h(@project.name) - else - title="#{global_role_name(@role)}" - end -%> -<div class="subtitle">» <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div> -<h1><%= title %></h1> -<br/> -<div> - <form action="<%= url_for :action => 'set_groups' -%>" method="post"> - <input name="resource" value="<%= params[:resource] -%>" type="hidden"/> - <input name="role" value="<%= @role -%>" type="hidden"/> - <input name="redirect" value="<%= params[:redirect] -%>" type="hidden"/> - <input name="q" value="<%= params[:q] -%>" type="hidden" /> - <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" /> - <input name="page" value="<%= params[:page] -%>" type="hidden" /> - <table> - <tbody> - <tr> - <td style="padding: 5px 0;" valign="top"> - <h2>Add Groups</h2> - <select name="from" id="from" size="20" style="margin: 5px 0; width: 300px;" multiple="multiple"> - <% ungranted_groups.each do |group| %> - <option value="<%= group ? group.id : '' -%>"><%= group_name(group) -%></option> - <% end %> - </select> - </td> - <td style="padding: 0 10px;" align="center"> - <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> - <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> - <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> - <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> - </td> - <td class="box" style="padding: 5px 10px;" valign="top"> - <h2>Role: <%= @project ? role_name(@role) : global_role_name(@role) -%></h2> - - <select name="groups[]" id="to" size="20" multiple="multiple" style="margin: 5px 0pt; width: 300px;"> - <% granted_groups.each do |group| %> - <option value="<%= group ? group.id : '' -%>"><%= group_name(group) -%></option> - <% end %> - </select><br> - - <div style="padding: 5px 0;"> - <input id="save" value="Save" onclick="SelectBox.select_all('to');submit();return false;" type="submit"> - <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>"><%= message 'cancel' -%></a> - </div> - </td> - </tr> - </tbody> - </table> - </form> - <script> - SelectBox.init('from'); - SelectBox.init('to'); - </script> -</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb deleted file mode 100644 index 08f655b0aaa..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/edit_users.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -<% - granted_users=users(@role, params[:resource]) - ungranted_users=(all_users - granted_users) - if @project - title='Role Membership For: ' + h(@project.name) - else - title="#{global_role_name(@role)}" - end -%> -<div class="subtitle">» <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>">Back</a></div> -<h1><%= title %></h1> -<br/> -<div id="main_content"> - <form action="<%= url_for :action => 'set_users' -%>" method="post"> - <input name="resource" value="<%= params[:resource] -%>" type="hidden"/> - <input name="role" value="<%= @role -%>" type="hidden" /> - <input name="redirect" value="<%= params[:redirect] -%>" type="hidden" /> - <input name="q" value="<%= params[:q] -%>" type="hidden" /> - <input name="qualifier" value="<%= params[:qualifier] -%>" type="hidden" /> - <input name="page" value="<%= params[:page] -%>" type="hidden" /> - <table> - <tbody> - <tr> - <td style="padding: 5px 0;" valign="top"> - <h2>Add Users</h2> - <select name="from" id="from" size="30" style="margin: 5px 0; width: 300px;" multiple="multiple"> - <% ungranted_users.each do |user| %> - <option value="<%= user.id -%>"><%= user.name -%></option> - <% end %> - </select> - </td> - <td style="padding: 0 10px;" align="center"> - <button id="select_right" onclick="SelectBox.move('from', 'to');SelectBox.sort('to');SelectBox.redisplay('to');return false;">select >></button><br> - <button id="select_right_all" onclick="SelectBox.move_all('from', 'to');return false;">select all >></button><br><br> - <button id="select_left" onclick="SelectBox.move('to', 'from');return false;"><< unselect</button><br> - <button id="select_left_all" onclick="SelectBox.move_all('to', 'from');return false;"><< unselect all</button> - </td> - <td class="box" style="padding: 5px 10px;" valign="top"> - <h2>Role: <%= @project ? role_name(@role) : global_role_name(@role) -%></h2> - - <select name="users[]" id="to" size="30" multiple="multiple" style="margin: 5px 0; width: 300px;"> - <%= options_from_collection_for_select(granted_users, "id", "name") %> - </select><br> - - <div style="padding: 5px 0;"> - <input id="save" value="Save" onclick="SelectBox.select_all('to');submit();return false;" type="submit"> - <a href="<%= url_for :action => params[:redirect], :q => params[:q], :qualifier => params[:qualifier] -%>"><%= message 'cancel' -%></a> - </div> - </td> - </tr> - </tbody> - </table> - </form> - <script> - SelectBox.init('from'); - SelectBox.init('to'); - </script> -</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb index ff6e336ee74..de6f010ae2f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb @@ -16,11 +16,13 @@ <span class="small gray"><%= message('global_permissions.' + global_permission_key + '.desc') -%></span></td> <td valign="top" style="word-break:break-all;width:30%;"> <span><%= users(global_permission_key).map(&:name).join(', ') -%></span> - (<%= link_to "select", {:action => 'edit_users', :role => global_permission_key, :redirect => 'global'}, :class => 'link-action', :id => "select-users-#{global_permission_key}" -%>) + (<%= link_to message('select'), {:action => :edit_users, :role => global_permission_key}, + :id => "select-users-#{global_permission_key}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> </td> <td valign="top" style="word-break:break-all;width:30%;"> <span><%= groups(global_permission_key).map{|g| group_name(g)}.join(', ') %></span> - (<%= link_to "select", {:action => 'edit_groups', :role => global_permission_key, :redirect => 'global'}, :class => 'link-action', :id => "select-groups-#{global_permission_key}" -%>) + (<%= link_to message('select'), {:action => :edit_groups, :role => global_permission_key}, + :id => "select-groups-#{global_permission_key}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> </td> </tr> <% end %> 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 d2bea8d3bfe..8fc851b830b 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 @@ -71,9 +71,11 @@ groups=Api::Utils.insensitive_sort(project.group_roles.select { |gr| gr.role=='admin' }.map { |gr| group_name(gr.group) }) %> <span id="u-admin-<%= u project.kee -%>"><%= users.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=admin&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectu-admin-<%= u project.kee -%>">select users</a>)<br/> + (<%= link_to message('select users'), {:action => :edit_users, :role => 'admin', :resource => project.id}, + :id => "selectu-admin-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> <span id="g-admin-<%= u project.kee -%>"><%= groups.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=admin&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectg-admin-<%= u project.kee -%>">select groups</a>) + (<%= link_to message('select groups'), {:action => :edit_groups, :role => 'admin', :resource => project.id}, + :id => "selectg-admin-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> </td> <td valign="top"> <% @@ -81,9 +83,11 @@ groups=Api::Utils.insensitive_sort(project.group_roles.select { |gr| gr.role=='user' }.map { |gr| group_name(gr.group) }) %> <span id="u-user-<%= u project.kee -%>"><%= users.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=user&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectu-user-<%= u project.kee -%>">select users</a>)<br/> + (<%= link_to message('select users'), {:action => :edit_users, :role => 'user', :resource => project.id}, + :id => "selectu-user-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> <span id="g-user-<%= u project.kee -%>"><%= groups.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=user&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectg-user-<%= u project.kee -%>">select groups</a>) + (<%= link_to message('select groups'), {:action => :edit_groups, :role => 'user', :resource => project.id}, + :id => "selectg-user-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> </td> <td valign="top"> <% @@ -91,9 +95,11 @@ groups=Api::Utils.insensitive_sort(project.group_roles.select { |gr| gr.role=='codeviewer' }.map { |gr| group_name(gr.group) }) %> <span id="u-codeviewer-<%= u project.kee -%>"><%= users.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_users?redirect=projects&role=codeviewer&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectu-codeviewer-<%= u project.kee -%>">select users</a>)<br/> + (<%= link_to message('select users'), {:action => :edit_users, :role => 'codeviewer', :resource => project.id}, + :id => "selectu-codeviewer-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> <span id="g-codeviewer-<%= u project.kee -%>"><%= groups.join(', ') %></span> - (<a href="<%= ApplicationController.root_context -%>/roles/edit_groups?redirect=projects&role=codeviewer&resource=<%= project.id -%>&q=<%= u params[:q] -%>&qualifier=<%= @qualifier -%>&page=<%= params[:page] -%>" class="link-action" id="selectg-codeviewer-<%= u project.kee -%>">select groups</a>) + (<%= link_to message('select groups'), {:action => :edit_groups, :role => 'codeviewer', :resource => project.id}, + :id => "selectg-codeviewer-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/> </td> </tr> <% |