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>