]> source.dussan.org Git - sonarqube.git/commitdiff
Set groups permission height the same size as users
authorJulien Lancelot <julien.lancelot@gmail.com>
Thu, 18 Jul 2013 16:33:54 +0000 (18:33 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Thu, 18 Jul 2013 16:33:54 +0000 (18:33 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_groups.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/roles/_edit_users.html.erb

index 41a917e0f854d7eed0312979f3337b211485d9b5..c6916f9e02eca40499b5838d555a11a26187b23c 100644 (file)
@@ -3,66 +3,65 @@
   granted_groups=groups(@role, project_id)
   ungranted_groups=all_groups - granted_groups
 %>
-<div>
-  <form id="permission-groups-form" action="<%= url_for :controller => :roles, :action => :set_groups -%>" method="post">
-    <input name="resource" value="<%= project_id -%>" type="hidden"/>
-    <input name="role" value="<%= @role -%>" type="hidden"/>
-    <fieldset>
-      <div class="modal-head">
-        <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "System #{message("global_permissions.#{@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" nowrap="nowrap">
-                  <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>
+<form id="permission-groups-form" action="<%= url_for :controller => :roles, :action => :set_groups -%>" method="post">
+  <input name="resource" value="<%= project_id -%>" type="hidden"/>
+  <input name="role" value="<%= @role -%>" type="hidden"/>
+  <fieldset>
+    <div class="modal-head">
+      <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "Edit system permissions: #{message("global_permissions.#{@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="30" 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" nowrap="nowrap">
+                <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="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');
+                <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>
 
-    $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>
+<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>
index e38ea8aca09d95912306b68772d260e24a4e1d7a..9c3cd32364ee1d80859b0e5c8fbf420fdc3f9856 100644 (file)
@@ -8,7 +8,7 @@
   <input name="role" value="<%= @role -%>" type="hidden" />
   <fieldset>
     <div class="modal-head">
-      <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "System #{message("global_permissions.#{@role}")}" -%></h2>
+      <h2><%= @project ? 'Edit permissions for: ' + h(@project.name) : "Edit system permissions: #{message("global_permissions.#{@role}")}" -%></h2>
     </div>
     <div class="modal-body">
       <div id="permission-users-error" class="permission-users error" style="display:none;" />