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, ...
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
module AuditsHelper
|
||||
def truncate_audit_value(resource, field, value)
|
||||
truncate(audit_value(resource, field, value), length: 50)
|
||||
end
|
||||
|
||||
def audit_value(resource, field, value)
|
||||
if value.is_a?(Array)
|
||||
truncate(value.join(","), length: 50)
|
||||
value.join(",")
|
||||
elsif resource.type_for_attribute(field.to_s).type == :boolean
|
||||
resource.class.human_attribute_name("#{field}_#{value}")
|
||||
else
|
||||
truncate(value.to_s, length: 50)
|
||||
value.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user