]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4466 Labels and layout adjustments
authorJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Thu, 18 Jul 2013 16:19:36 +0000 (18:19 +0200)
committerJean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com>
Thu, 18 Jul 2013 16:19:36 +0000 (18:19 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/helpers/roles_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_groups.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/_edit_users.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb

index 5e19deccc6ef128851b563e644715ee39bd94951..7b78c5e675351056568282556fba983a33ab7c90 100644 (file)
@@ -2280,7 +2280,7 @@ permission_template.do_you_want_to_delete_template_xxx=Are you sure that you wan
 permission_template.delete_template=Delete
 permission_template.edit_template=Edit permission template
 permission_template.update_template=Update
-permission_template.edit_permissions=Edit permissions
+permission_template.edit_permissions=Edit permissions: {0}
 permission_template.update_permissions=Save
 permission_template.no_results=No template to display
 permission_template.set_default_templates=Set default templates
index d2a2bceff5dcc566206fbcb677fcb25d90801666..1457c3c0fe3916cb8d617f466dc36a76be311740 100644 (file)
@@ -184,7 +184,7 @@ class PermissionTemplatesController < ApplicationController
   def default_templates_form
     all_templates = Internal.permission_templates.selectAllPermissionTemplates
 
-    @permission_templates_options = all_templates.collect {|t| [t.name, t.key]}
+    @permission_templates_options = all_templates.sort_by {|t| t.name}.collect {|t| [t.name, t.key]}
     @root_qualifiers = get_root_qualifiers
     @default_templates = get_default_templates_per_qualifier(@root_qualifiers)
 
@@ -228,7 +228,7 @@ class PermissionTemplatesController < ApplicationController
     templates_names.each do |template_name|
       permission_templates << Internal.permission_templates.selectPermissionTemplate(template_name)
     end
-    permission_templates
+    permission_templates.sort_by {|t| t.name}
   end
 
 end
index dd144499d784916ddab7d31ccca0cef69198519c..126d77112aee9403290ff80d1cf932ec1d24e823 100644 (file)
@@ -77,7 +77,7 @@ class RolesController < ApplicationController
 
   # GET /roles/apply_template_form?projects=<projects>&qualifier=<qualifier>
   def apply_template_form
-    @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().collect {|pt| [pt.name, pt.key]}
+    @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().sort_by {|t| t.name}.collect {|pt| [pt.name, pt.key]}
     render :partial => 'apply_template_form', :locals => {:components => params[:projects], :project_name => params[:project_name], :qualifier => params[:qualifier] || 'TRK'}
   end
 
index a774e513a0122a6cf099870ca2ece1964857e619..db14faf8259c390b380cde7af0702e1acb2fd38c 100644 (file)
@@ -88,12 +88,12 @@ module RolesHelper
 
   def link_to_edit_roles_permission_form(label, role, resource_id, html_id)
     link_to message(label), {:controller => :roles, :action => :edit_users, :role => role, :resource => resource_id},
-            :id => html_id, :class => 'open-modal link-action', 'modal-width' => '780px'
+            :id => html_id, :class => 'open-modal link-action nowrap', 'modal-width' => '780px'
   end
 
   def link_to_edit_groups_permission_form(label, role, resource_id, html_id)
     link_to message(label), {:controller => :roles, :action => :edit_groups, :role => role, :resource => resource_id},
-            :id => html_id, :class => 'open-modal link-action', 'modal-width' => '780px'
+            :id => html_id, :class => 'open-modal link-action nowrap', 'modal-width' => '780px'
   end
 
 end
index eb9e147f375a5b94060ae1e752818b8a28ff7ccf..98d081b349293174122f31d93d8cf9952ee4af33 100644 (file)
@@ -4,7 +4,7 @@
   <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', :params => @permission_template.name) -%></h2>
     </div>
     <div class="modal-body">
       <div id="permission-template-error" class="permission-template error" style="display:none;" />
@@ -12,7 +12,7 @@
         <tbody>
         <tr>
           <td style="padding: 5px 0;" valign="top">
-            <h2>Add Users</h2>
+            <h2>Add Groups</h2>
 
             <select name="from" id="from" size="30" style="margin: 5px 0; width: 300px;" multiple="multiple">
               <% @groups_without_permission.sort.each do |group| %>
index e4cd1477aec749b47d3870a1b34c9a7a815a4c23..38dc4fdbb677a5ff9e14fc05c265bae063b70a00 100644 (file)
@@ -4,7 +4,7 @@
   <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', :params => @permission_template.name) -%></h2>
     </div>
     <div class="modal-body">
       <div id="permission-template-error" class="permission-template error" style="display:none;" />
index 4a3c0d0499cddc0df12f9d7a28e87c90baa6328b..0f3cef7d04579d0e4361fb7abdeb96601cc8fecf 100644 (file)
              users=Api::Utils.insensitive_sort(permission_template.getUsersForPermission(permission).collect {|u| u.userName})
              groups=Api::Utils.insensitive_sort(permission_template.getGroupsForPermission(permission).collect {|g| g.groupName.blank? ? 'Anyone' : g.groupName})
           %>
-          <span id="u-<%= permission -%>-<%= u permission_template.name -%>"><%= users.join(', ') %></span>
+          <span class="nowrap" id="u-<%= permission -%>-<%= u permission_template.name -%>"><%= users.join(', ') %></span>
           (<%= link_to message('select users'), {:action => :edit_users, :name => permission_template.name, :permission => permission},
-                       :id => "selectu-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action', 'modal-width' => '780px' %>)<br/>
-          <span id="g-<%= permission -%>-<%= u permission_template.name -%>"><%= groups.join(', ') %></span>
+                       :id => "select-u-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action nowrap', 'modal-width' => '780px' %>)<br/>
+          <span class="nowrap" id="g-<%= permission -%>-<%= u permission_template.name -%>"><%= groups.join(', ') %></span>
           (<%= link_to message('select groups'), {:action => :edit_groups, :name => permission_template.name, :permission => permission},
-                       :id => "selectg-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action', 'modal-width' => '780px' %>)<br/>
+                       :id => "select-g-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action nowrap', 'modal-width' => '780px' %>)<br/>
         </td>
       <% end %>
       <td>
index b7c04c22d0677de41f1701774172ab326811c6b3..2889a02842f6a7e17f14c4cdf9f9a952968a053e 100644 (file)
@@ -22,7 +22,7 @@
           <%= label_tag 'template_key', 'Permission template:' %>
           <%= select_tag('template_key', options_for_select(@permission_templates, -1), :style => 'width: 250px;') %>
           <% unless params[:project_name] %>
-            <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}(s)" %>)</span><br/>
+            <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}s" %>)</span><br/>
           <% end %>
         </div>
       <% end %>
index c7d5f586037c3f1c89dc0bb74f1d4a79494ea54c..a1baaff9167cfd02653adc9ce60c6a9e86ebb21f 100644 (file)
              users=Api::Utils.insensitive_sort(project.user_roles.select { |ur| ur.role==permission }.map { |ur| ur.user.name })
              groups=Api::Utils.insensitive_sort(project.group_roles.select { |gr| gr.role==permission }.map { |gr| group_name(gr.group) })
           %>
-          <span id="u-<%= permission -%>-<%= u project.kee -%>"><%= users.join(', ') %></span>
-          (<%= link_to_edit_roles_permission_form(message('select users'), permission, project.id, "selectu-#{permission}-#{u project.kee}") %>)<br/>
-          <span id="g-<%= permission -%>-<%= u project.kee -%>"><%= groups.join(', ') %></span>
-          (<%= link_to_edit_groups_permission_form(message('select groups'), permission, project.id, "selectg-#{permission}-#{u project.kee}") %>)<br/>
+          <span class="nowrap" id="u-<%= permission -%>-<%= u project.kee -%>"><%= users.join(', ') %></span>
+          (<%= link_to_edit_roles_permission_form(message('select users'), permission, project.id, "select-u-#{permission}-#{u project.kee}") %>)<br/>
+          <span class="nowrap" id="g-<%= permission -%>-<%= u project.kee -%>"><%= groups.join(', ') %></span>
+          (<%= link_to_edit_groups_permission_form(message('select groups'), permission, project.id, "select-g-#{permission}-#{u project.kee}") %>)<br/>
         </td>
       <% end %>
       <td align="right">
         <%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :projects => [project.id], :project_name => project.name, :qualifier => @qualifier},
-                    :id => "apply-template-modal-#{project.id}", :class => 'open-modal link-action' %>
+                    :id => "apply-template-#{u project.kee}", :class => 'open-modal link-action' %>
       </td>
     </tr>
   <%