To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / groups / _users.html.erb @ 912:5e80956cc792

History | View | Annotate | Download (1.49 KB)

1 0:513646585e45 Chris
<div class="splitcontentleft">
2
<% if @group.users.any? %>
3 909:cbb26bc654de Chris
  <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 l(:button_delete), { :url => group_user_path(@group, :user_id => user), :method => :delete }, :class => 'icon icon-del' %>
14
        </td>
15
      </tr>
16
    <% end %>
17
    </tbody>
18
  </table>
19 0:513646585e45 Chris
<% else %>
20 909:cbb26bc654de Chris
  <p class="nodata"><%= l(:label_no_data) %></p>
21 0:513646585e45 Chris
<% end %>
22
</div>
23
24
<div class="splitcontentright">
25 441:cbce1fd3b1b7 Chris
<% users = User.active.not_in_group(@group).all(:limit => 100) %>
26 0:513646585e45 Chris
<% if users.any? %>
27 909:cbb26bc654de Chris
  <% remote_form_for(@group, :url => group_users_path(@group), :html => {:method => :post}) do |f| %>
28 0:513646585e45 Chris
    <fieldset><legend><%=l(:label_user_new)%></legend>
29 909:cbb26bc654de Chris
30
    <p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
31
    <%= observe_field(:user_search,
32 0:513646585e45 Chris
                 :frequency => 0.5,
33
                 :update => :users,
34 909:cbb26bc654de Chris
                 :url => autocomplete_for_user_group_path(@group),
35
                 :method => :get,
36 0:513646585e45 Chris
                 :with => 'q')
37
                  %>
38 909:cbb26bc654de Chris
39
    <div id="users">
40
      <%= principals_check_box_tags 'user_ids[]', users %>
41
    </div>
42
43 0:513646585e45 Chris
    <p><%= submit_tag l(:button_add) %></p>
44 909:cbb26bc654de Chris
    </fieldset>
45 0:513646585e45 Chris
  <% end %>
46
<% end %>
47
48
</div>