Sprankelprachtig aan/afmeldsysteem

index.html.erb 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <h1>Members of <%= @group.name %></h1>
  2. <table class="table table-striped">
  3. <thead>
  4. <tr>
  5. <th><%= t 'activerecord.attributes.group.name' %></th>
  6. <% if @admin %>
  7. <th colspan="2"><%= t :actions %></th>
  8. <% end %>
  9. </tr>
  10. </thead>
  11. <tbody>
  12. <% @members.each do |member| %>
  13. <tr>
  14. <td>
  15. <%= link_to member.person.full_name, group_member_path(@group, member) %>
  16. <% if member.is_leader %>
  17. (<i class="fa fa-angle-up"></i>)
  18. <% end %>
  19. </td>
  20. <% if @admin and current_person != member.person %>
  21. <% if member.is_leader %>
  22. <td>
  23. <%= link_to t('groups.demote'), demote_group_member_path(@group, member), method: :post, data: { confirm: t(:areyousure)} %>
  24. </td>
  25. <% else %>
  26. <td>
  27. <%= link_to t('groups.promote'), promote_group_member_path(@group, member), method: :post, data: { confirm: t(:areyousure)} %>
  28. </td>
  29. <% end %>
  30. <td>
  31. <%= link_to t(:remove), group_member_path(@group, member), method: :delete, data: { confirm: t(:areyousure)} %>
  32. </td>
  33. <% else %>
  34. <td></td><td></td>
  35. <% end %>
  36. </tr>
  37. <% end %>
  38. </tbody>
  39. </table>
  40. <br>
  41. <%= link_to t('groups.member.add'), new_group_member_path(@group) %> |
  42. <%= link_to t('groups.member.invite'), group_invite_path(@group) %>