Improve interface of change log table
The name of the changed field is translated, values are truncated so descriptions with thousands of character would make this table huge and impossible to read, dates are localized, and values like arrays and booleans are displayed properly.
This commit is contained in:
@@ -20,15 +20,15 @@
|
||||
<% audit.audited_changes.each do |field, (old_value, new_value)| %>
|
||||
<tr>
|
||||
<td class="text-center"><%= audit.id %></td>
|
||||
<td class="small"><%= field.capitalize %></td>
|
||||
<td class="small"><%= sanitize(resource.class.human_attribute_name(field)) %></td>
|
||||
<td class="small">
|
||||
<div class="audit-value"><%= old_value %></div>
|
||||
<div class="audit-value"><%= truncate_audit_value(resource, field, old_value) %></div>
|
||||
</td>
|
||||
<td class="small">
|
||||
<div class="audit-value"><%= new_value %></div>
|
||||
<div class="audit-value"><%= truncate_audit_value(resource, field, new_value) %></div>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= audit.created_at.to_date %>
|
||||
<%= l audit.created_at.to_date %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= audit.user&.name %>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="small-12 medium-4 column">
|
||||
<p>
|
||||
<strong><%= t("admin.budget_investments.show.selection.title") %></strong>:
|
||||
<%= t("admin.budget_investments.show.selection.#{@investment.selected?}") %>
|
||||
<%= @investment.class.human_attribute_name("selected_#{@investment.selected?}") %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
|
||||
Reference in New Issue
Block a user