mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
66 lines
2.5 KiB
Plaintext
66 lines
2.5 KiB
Plaintext
<%= link_to "Back to #{@tournament_name}", "/tournaments/#{@tournament_id}", :class=>"btn btn-default" %>
|
|
<br>
|
|
<br>
|
|
|
|
|
|
|
|
<% if @users %>
|
|
<h1>Search results</h1> <%= form_tag(tournament_delegate_path, :method => "get", id: "search-form") do %>
|
|
<%= text_field_tag :search, params[:search], placeholder: "Search users" %>
|
|
<%= submit_tag "Search" %>
|
|
<% end %>
|
|
<p>Search by email address</p>
|
|
</br>
|
|
</br>
|
|
<table class="table table-striped table-bordered table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>User Email</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @users.each do |user| %>
|
|
<tr>
|
|
<td><%= user.email %></td>
|
|
<td>
|
|
<%= form_for TournamentDelegate.new, :url => url_for(:controller => 'tournaments', :action => 'delegate', :method => "post") do |f| %>
|
|
<%= f.hidden_field :user_id, :value => user.id %>
|
|
<% if can? :manage, @tournament %>
|
|
<%= submit_tag "Give permissions", :class=>"btn btn-success"%>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %>
|
|
|
|
<% if @users_delegates %>
|
|
<h1>Delegated users</h1> <%= form_tag(tournament_delegate_path, :method => "get", id: "search-form") do %>
|
|
<%= text_field_tag :search, params[:search], placeholder: "Search users" %>
|
|
<%= submit_tag "Search" %>
|
|
<% end %>
|
|
<p>Search by email address</p>
|
|
</br>
|
|
</br>
|
|
<table class="table table-striped table-bordered table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>User Email</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @users_delegates.each do |delegate| %>
|
|
<tr>
|
|
<td><%= delegate.user.email %></td>
|
|
<td><%= link_to 'Remove permissions', "/tournaments/#{@tournament.id}/#{delegate.id}/remove_delegate", method: :delete, confirm: 'Are you sure?', :class=>"btn btn-danger btn-sm" %></td>
|
|
</tr>
|
|
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %> |