app/views/security_events/_table.html.erb
<%# locals:
- security_events
- next_page (optional)
- prev_page (optional)
- show_user (optional)
%>
<div class="grid-container padding-0">
<div class="grid-row">
<table class="usa-table grid-col-fill">
<thead>
<tr>
<% if local_assigns[:show_user] %>
<th scope="col">User</th>
<% end %>
<th scope="col">Type</th>
<th scope="col">Issued At</th>
</tr>
</thead>
<tbody>
<% security_events.each do |security_event| %>
<tr>
<% if local_assigns[:show_user] %>
<td>
<%= security_event.user.email %>
</td>
<% end %>
<td>
<%= link_to(
friendly_name(security_event),
security_event_path(security_event)
) %>
</td>
<td>
<%= l(security_event.issued_at, format: :long) %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="grid-container padding-0">
<div class="grid-row">
<div class="grid-col-auto">
<% if local_assigns[:prev_page] %>
<%= link_to prev_page do %>
← Previous
<% end %>
<% else %>
<span class="text-base-light">
← Previous
</span>
<% end %>
</div>
<div class="grid-col-fill">
</div>
<div class="grid-col-auto">
<% if local_assigns[:next_page] %>
<%= link_to next_page do %>
Next →
<% end %>
<% else %>
<span class="text-base-light">
Next →
</span>
<% end %>
</div>
</div>
</div>