main
 1<div class="box">
 2  <article class="media">
 3    <div class="media-left">
 4      <span class="icon is-large">
 5        <i class="fas <%= audit_icon_for(audit) %> fa-3x" aria-hidden="true"></i>
 6      </span>
 7    </div>
 8    <div class="media-content">
 9      <div class="content">
10        <p>
11          <strong><%= t("activerecord.models.#{audit.auditable_type.underscore}") %></strong> <small><%= t(audit.action) %></small> <small><%= local_time_ago(audit.created_at) %></small>
12          <%= t('.by') %> <%= audit.user&.email %> <%= t('.from') %> <%= audit.remote_address %> <%= t('.version', version: audit.version) %>
13        </p>
14        <table class="table is-bordered is-narrow is-hoverable is-striped is-fullwidth">
15          <thead>
16            <th><%= t('.attribute') %></th>
17            <th><%= t('.old') %></th>
18            <th><%= t('.new') %></th>
19          </thead>
20          <tbody>
21            <% audit.audited_changes.each do |(key, value)| %>
22            <tr>
23              <% old = value.is_a?(Array) ? value[0] : nil %>
24              <% new = value.is_a?(Array) ? value[1] : value %>
25              <td><%= t("activerecord.attributes.#{audit.auditable_type.underscore}.#{key}") %></td>
26              <td title="<%= old %>"><p class="attribute-truncate"><%= old %></p></td>
27              <td title="<%= new %>"><p class="attribute-truncate"><%= new %></p></td>
28            </tr>
29            <% end %>
30          </tbody>
31        </table>
32      </div>
33    </div>
34  </article>
35</div>