Files
nairobi/app/views/admin/audits/show.html.erb
Javi Martín 5192ac052f Improve user interface showing a change log entry
Don't use <label> tags for things that are not labels, add a proper
<title> for the page, add a back link, remove an unnecessary
`inline-block` style for a header, localize dates and field names, ...

The interface could be further improve: proper diffs for long texts,
better separation between fields, ...
2019-11-05 13:23:11 +01:00

21 lines
903 B
Plaintext

<% provide(:title) do %>
<%= t("admin.audits.title") %>
<% end %>
<%= back_link_to polymorphic_path([:admin, *resource_hierarchy_for(@audit.associated || @audit.auditable)]) %>
<h2><%= t("admin.audits.title") %></h2>
<p><strong><%= t("admin.audits.edited_at") %></strong> <%= l @audit.created_at.to_date %></p>
<p><strong><%= t("admin.audits.edited_by") %></strong> <%= @audit.user&.name %></p>
<h3><%= t("admin.audits.changes") %></h3>
<% @audit.audited_changes.each do |field, (old_value, new_value)| %>
<strong><%= t("admin.audits.field") %></strong>
<p><%= sanitize(@audit.auditable.class.human_attribute_name(field)) %></p>
<strong><%= t("admin.audits.old_value") %></strong>
<p><%= wysiwyg(audit_value(@audit.auditable, field, old_value)) %></p>
<strong><%= t("admin.audits.new_value") %></strong>
<p><%= wysiwyg(audit_value(@audit.auditable, field, new_value)) %></p>
<% end %>