-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_access_logs_table.html.erb
More file actions
39 lines (38 loc) · 1.14 KB
/
_access_logs_table.html.erb
File metadata and controls
39 lines (38 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<table border="1">
<thead>
<tr>
<th>Hora</th>
<th>Matrícula/CPF</th>
<th>Nome</th>
<th>Curso</th>
<th>Resultado</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
<% logs.each do |log| %>
<tr>
<td><%= l(log.created_at) %></td>
<td><%= log.identifier %></td>
<td><%= log.person_name %></td>
<td><%= log.course_name %></td>
<td>
<% if log.allowed? %>
<span style="color: green;"><%= log.access_result %></span>
<% elsif log.denied? %>
<span style="color: red;"><%= log.access_result %></span>
<% else %>
<span style="color: orange;"><%= log.access_result %></span>
<% end %>
</td>
<td>
<% if defined?(current_user) && current_user&.role&.name == 'admin' %>
<%= link_to "Excluir", log, data: { turbo_method: :delete, turbo_confirm: "Tem certeza que deseja excluir este registro?" }, style: "color: red;" %>
<% else %>
<small>Sem permissão</small>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>