<h1 class="title">Listing Groups</h1>

<table class="groups striped">
  <tr>
    <th class="name">Name</th>
    <th class="created">Created</th>
    <th class="founder">Founder</th>
    <th class="actions"></th>
  </tr>

  <% @groups.each do |group| %>
    <tr>
      <td><%= link_to (h group.name), group %></td>
      <td><%= h group.created_at.strftime("%d %B %y") %></td>
      <td><%= link_to (h group.founder.username), group.founder %></td>
      <td class="actions">
        <%= link_to icon('pencil'), edit_group_path(group) %>
        <% if group.can_destroy? cuser %>
          <%= link_to icon('times'), group, confirm: 'Are you sure?', method: :delete %>
        <% end %>
      </td>
    </tr>
  <% end %>
</table>

<%= link_to 'New Group', new_group_path, class: 'button' %>
