Page MenuHomeGRNET

index.html.erb
No OneTemporary

File Metadata

Created
Sat, Mar 21, 2:15 AM

index.html.erb

<div>
<%= bootstrap_form_tag(url: update_groups_admin_users_path, method: 'PUT', layout: :horizontal, label_col: 'col-sm-2', control_col: 'col-sm-4') do |f| %>
<table id=user-list" class="table table-striped table-bordered">
<thead>
<tr>
<th>Username</th>
<th>Groups</th>
<th>Controls</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
<% @users.each do |u| %>
<tr>
<td><%= u.email %></td>
<td><%= f.collection_select "orphan-#{u.id}", Group.all, :id, :name, hide_label: true, prompt: 'Group' %></td>
<td><%= link_to 'Delete', admin_user_path(u), method: :delete, data: { confirm: "Are sure you want to delete #{u.email}?"} %></td>
<% if u.admin %>
<% content = "Are you sure you want to remove admin priviledges from #{u.email}?" %>
<% prefix = "Remove" %>
<% else %>
<% content = "Are you sure you want to make #{u.email} an admin?" %>
<% prefix = "Make" %>
<% end %>
<td><%= link_to "#{prefix} admin", edit_admin_user_path(u), data: { confirm: content} %></td>
<% end %>
</tr>
<tbody>
</table>
<%= f.submit 'Apply', class: 'btn btn-primary' %>
<% end %>
</div>

Event Timeline