_participants_panel.html.erb 946 B

12345678910111213141516171819202122232425262728
  1. <div class="panel panel-primary">
  2. <div class="panel-heading">
  3. <%= role.to_s.capitalize.pluralize %>
  4. </div>
  5. <table class="panel-body table table-striped table-bordered table-hover">
  6. <tbody>
  7. <% for user in users %>
  8. <tr>
  9. <td>
  10. <%= render user %>
  11. </td>
  12. <% if current_user.is_administrator_at?(@course.school) || current_user.admin? %>
  13. <td>
  14. <%= form_for @course.course_participations.find_by(user_id: user.id), html: { method: :delete } do |f| %>
  15. <%= f.submit "Remove", class: "btn btn-danger" %>
  16. <% end %>
  17. </td>
  18. <% end %>
  19. </tr>
  20. <% end %>
  21. </tbody>
  22. </table>
  23. <div class="panel-footer">
  24. <% if current_user.is_administrator_at?(@course.school) || current_user.admin? %>
  25. <%= render partial: 'course_participations/form', locals: { role: role } %>
  26. <% end %>
  27. </div>
  28. </div>