easy-admin-rails 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0785f402aff13dbf037ade8d523c93b2301d6aecb75e1683201e30c35f706133'
|
4
|
+
data.tar.gz: 81fea48355b3f283adad25cb54bff8f0e45c8d578352214660d5b5f9684877d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f81b31d09b749920999545be5739eaae90d2c54b5bd15775f3a90eda508fe1dc935173c1c615db07ec6149d1597e53a8d6e93f76bee3f7ca36bc536551612d35
|
7
|
+
data.tar.gz: 1a172c3721cc6deafc75383f219809609ed7ff6549471adf613ef27a2051f3f0a066382dc86e8630d1480b2536204d4ab1db5160bbcfafc1c979333ba430e8b9
|
@@ -283,9 +283,13 @@ module EasyAdmin
|
|
283
283
|
changes = {}
|
284
284
|
current_attrs = current_item.attributes
|
285
285
|
|
286
|
-
|
286
|
+
# Only check fields that exist in the old_attrs (were tracked by Paper Trail)
|
287
|
+
old_attrs.keys.each do |key|
|
287
288
|
next if %w[id updated_at].include?(key.to_s)
|
288
289
|
|
290
|
+
# Skip if field wasn't tracked in this version
|
291
|
+
next unless old_attrs.has_key?(key)
|
292
|
+
|
289
293
|
old_val = normalize_value_for_comparison(old_attrs[key])
|
290
294
|
new_val = normalize_value_for_comparison(current_attrs[key])
|
291
295
|
|
@@ -11,16 +11,11 @@ module EasyAdmin
|
|
11
11
|
def view_template
|
12
12
|
content = lambda do
|
13
13
|
div(class: "w-full") do
|
14
|
-
# Timeline container
|
15
|
-
div(class: "
|
16
|
-
#
|
17
|
-
div(class: "absolute left-10 top-0 bottom-0 w-0.5 bg-gray-300 hidden sm:block")
|
18
|
-
|
19
|
-
# Version items - force vertical stacking (newest first)
|
14
|
+
# Timeline container
|
15
|
+
div(class: "space-y-0") do
|
16
|
+
# Version items with connected timeline
|
20
17
|
@versions.each_with_index do |version, index|
|
21
|
-
|
22
|
-
render_timeline_item_content(version, index)
|
23
|
-
end
|
18
|
+
render_timeline_item_content(version, index)
|
24
19
|
end
|
25
20
|
end
|
26
21
|
end
|
@@ -38,15 +33,21 @@ module EasyAdmin
|
|
38
33
|
private
|
39
34
|
|
40
35
|
def render_timeline_item_content(version, index)
|
41
|
-
div(class: "flex
|
42
|
-
# Timeline dot
|
43
|
-
div(class: "
|
44
|
-
#
|
36
|
+
div(class: "flex") do
|
37
|
+
# Timeline dot and connector
|
38
|
+
div(class: "flex flex-col items-center mr-4 hidden sm:flex") do
|
39
|
+
# Timeline dot
|
40
|
+
div(class: "w-3 h-3 bg-blue-500 rounded-full border-2 border-white shadow-md") do
|
41
|
+
end
|
42
|
+
# Connector line (hidden for last item)
|
43
|
+
unless index == @versions.size - 1
|
44
|
+
div(class: "w-0.5 bg-gray-300 flex-1 min-h-[2rem]")
|
45
|
+
end
|
45
46
|
end
|
46
47
|
|
47
|
-
# Content
|
48
|
-
div(class: "
|
49
|
-
div(class: "bg-white rounded-
|
48
|
+
# Content - flows horizontally from dot
|
49
|
+
div(class: "flex-1 pb-6") do
|
50
|
+
div(class: "bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-4") do
|
50
51
|
render_item_header(version)
|
51
52
|
render_item_content(version)
|
52
53
|
render_item_actions(version)
|
@@ -56,16 +57,16 @@ module EasyAdmin
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def render_item_header(version)
|
59
|
-
#
|
60
|
-
div(class: "px-
|
61
|
-
div(class: "flex items-center space-x-2
|
62
|
-
# Event badge -
|
63
|
-
span(class: "inline-flex items-center px-
|
60
|
+
# Compact header with reduced padding
|
61
|
+
div(class: "px-3 py-2 border-b border-gray-100 bg-gray-50/50 flex items-center justify-between") do
|
62
|
+
div(class: "flex items-center space-x-2") do
|
63
|
+
# Event badge - compact version
|
64
|
+
span(class: "inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600") do
|
64
65
|
version.event.capitalize
|
65
66
|
end
|
66
67
|
|
67
|
-
# Time ago
|
68
|
-
span(class: "text-sm
|
68
|
+
# Time ago - smaller text
|
69
|
+
span(class: "text-sm text-gray-900") do
|
69
70
|
time_ago_in_words(version.created_at) + " ago"
|
70
71
|
end
|
71
72
|
end
|
@@ -92,7 +93,7 @@ module EasyAdmin
|
|
92
93
|
|
93
94
|
def render_item_content(version)
|
94
95
|
# Match admin panel body padding (like in BaseCardComponent) - responsive padding
|
95
|
-
div(class: "p-
|
96
|
+
div(class: "p-3") do
|
96
97
|
if version.object.blank?
|
97
98
|
div(class: "text-sm text-gray-500") { "No change data available" }
|
98
99
|
return
|
data/lib/easy_admin/version.rb
CHANGED