You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_users.html.erb 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <div class="splitcontentleft">
  2. <% if @group.users.any? %>
  3. <table class="list users">
  4. <thead><tr>
  5. <th><%= l(:label_user) %></th>
  6. <th style="width:15%"></th>
  7. </tr></thead>
  8. <tbody>
  9. <% @group.users.sort.each do |user| %>
  10. <tr id="user-<%= user.id %>" class="<%= cycle 'odd', 'even' %>">
  11. <td class="user"><%= link_to_user user %></td>
  12. <td class="buttons">
  13. <%= link_to_remote(
  14. l(:button_delete),
  15. { :url => group_user_path(@group, :user_id => user),
  16. :method => :delete },
  17. :class => 'icon icon-del'
  18. ) %>
  19. </td>
  20. </tr>
  21. <% end %>
  22. </tbody>
  23. </table>
  24. <% else %>
  25. <p class="nodata"><%= l(:label_no_data) %></p>
  26. <% end %>
  27. </div>
  28. <div class="splitcontentright">
  29. <% users = User.active.not_in_group(@group).all(:limit => 100) %>
  30. <% if users.any? %>
  31. <%= form_for(@group, :remote => true, :url => group_users_path(@group),
  32. :html => {:method => :post}) do |f| %>
  33. <fieldset><legend><%=l(:label_user_new)%></legend>
  34. <p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
  35. <%= observe_field(:user_search,
  36. :frequency => 0.5,
  37. :update => :users,
  38. :url => autocomplete_for_user_group_path(@group),
  39. :method => :get,
  40. :before => '$("user_search").addClassName("ajax-loading")',
  41. :complete => '$("user_search").removeClassName("ajax-loading")',
  42. :with => 'q')
  43. %>
  44. <div id="users">
  45. <%= principals_check_box_tags 'user_ids[]', users %>
  46. </div>
  47. <p><%= submit_tag l(:button_add) %></p>
  48. </fieldset>
  49. <% end %>
  50. <% end %>
  51. </div>