active_storage_dashboard 0.1.2 → 0.1.4
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 +4 -4
- data/app/helpers/active_storage_dashboard/application_helper.rb +5 -5
- data/app/views/active_storage_dashboard/attachments/index.html.erb +1 -1
- data/app/views/active_storage_dashboard/attachments/show.html.erb +1 -1
- data/app/views/active_storage_dashboard/blobs/index.html.erb +2 -2
- data/app/views/active_storage_dashboard/blobs/show.html.erb +1 -1
- data/app/views/active_storage_dashboard/dashboard/index.html.erb +17 -8
- data/app/views/active_storage_dashboard/variant_records/show.html.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aed0ae00966171b7c5708ae0231f2c4f84ca19ad7a22741e270f93ccf2502a7
|
4
|
+
data.tar.gz: 95a0b2b47e44500724894f746364cf56d462b93a5170e4ec98abdc698b428878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b1e3afdab7ea4b241b87e2378aa01cee383449f817cc968cae35f5a0a30b1082656a78d0ee12b03c956af8fc4ca986e49e57009840893f881eada483794bf41
|
7
|
+
data.tar.gz: 529016b918bd05c2eebea22372fd7affec5f784d21524d2d2df00b0bec6e8b21d5522c9c7caa40a06b38e36d9b5d5966ed24b871a156f861ebdef029a872a3df
|
@@ -51,7 +51,7 @@ module ActiveStorageDashboard
|
|
51
51
|
html = []
|
52
52
|
|
53
53
|
if current_page > 1
|
54
|
-
html << link_to('« Previous',
|
54
|
+
html << link_to('« Previous', "#{request.path}?page=#{current_page - 1}", class: 'pagination-link')
|
55
55
|
else
|
56
56
|
html << content_tag(:span, '« Previous', class: 'pagination-link disabled')
|
57
57
|
end
|
@@ -66,7 +66,7 @@ module ActiveStorageDashboard
|
|
66
66
|
|
67
67
|
# First page
|
68
68
|
if window_start > 1
|
69
|
-
html << link_to('1',
|
69
|
+
html << link_to('1', "#{request.path}?page=1", class: 'pagination-link')
|
70
70
|
html << content_tag(:span, '...', class: 'pagination-ellipsis') if window_start > 2
|
71
71
|
end
|
72
72
|
|
@@ -75,18 +75,18 @@ module ActiveStorageDashboard
|
|
75
75
|
if page == current_page
|
76
76
|
html << content_tag(:span, page, class: 'pagination-link current')
|
77
77
|
else
|
78
|
-
html << link_to(page,
|
78
|
+
html << link_to(page, "#{request.path}?page=#{page}", class: 'pagination-link')
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
82
|
# Last page
|
83
83
|
if window_end < total_pages
|
84
84
|
html << content_tag(:span, '...', class: 'pagination-ellipsis') if window_end < total_pages - 1
|
85
|
-
html << link_to(total_pages,
|
85
|
+
html << link_to(total_pages, "#{request.path}?page=#{total_pages}", class: 'pagination-link')
|
86
86
|
end
|
87
87
|
|
88
88
|
if current_page < total_pages
|
89
|
-
html << link_to('Next »',
|
89
|
+
html << link_to('Next »', "#{request.path}?page=#{current_page + 1}", class: 'pagination-link')
|
90
90
|
else
|
91
91
|
html << content_tag(:span, 'Next »', class: 'pagination-link disabled')
|
92
92
|
end
|
@@ -63,7 +63,7 @@
|
|
63
63
|
<% end %>
|
64
64
|
</div>
|
65
65
|
<div class="attachment-info">
|
66
|
-
<h3 class="filename"><%= attachment.blob.filename %></h3>
|
66
|
+
<h3 class="filename" title="<%= attachment.blob.filename %>"><%= truncate(attachment.blob.filename.to_s, length: 100) %></h3>
|
67
67
|
<p class="attachment-name"><strong><%= attachment.name %></strong></p>
|
68
68
|
<p class="record-info"><%= attachment.record_type %> #<%= attachment.record_id %></p>
|
69
69
|
<p class="file-info">
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<% @blobs.each do |blob| %>
|
25
25
|
<tr>
|
26
26
|
<td><%= blob.id %></td>
|
27
|
-
<td><%= blob.filename %></td>
|
27
|
+
<td title="<%= blob.filename %>"><%= truncate(blob.filename.to_s, length: 100) %></td>
|
28
28
|
<td><%= blob.content_type || 'Unknown' %></td>
|
29
29
|
<td><%= format_bytes(blob.byte_size) %></td>
|
30
30
|
<td><%= blob.created_at.strftime('%Y-%m-%d %H:%M') %></td>
|
@@ -63,7 +63,7 @@
|
|
63
63
|
<% end %>
|
64
64
|
</div>
|
65
65
|
<div class="blob-info">
|
66
|
-
<h3 class="filename"><%= blob.filename %></h3>
|
66
|
+
<h3 class="filename" title="<%= blob.filename %>"><%= truncate(blob.filename.to_s, length: 100) %></h3>
|
67
67
|
<p class="record-info">ID: <%= blob.id %></p>
|
68
68
|
<p class="file-info">
|
69
69
|
<%= format_bytes(blob.byte_size) %> •
|
@@ -104,9 +104,9 @@
|
|
104
104
|
<% end %>
|
105
105
|
</div>
|
106
106
|
<div class="activity-content">
|
107
|
-
<div class="activity-title"><%= blob.filename %></div>
|
107
|
+
<div class="activity-title" title="<%= blob.filename %>"><%= truncate(blob.filename.to_s, length: 30) %></div>
|
108
108
|
<div class="activity-meta">
|
109
|
-
<span class="activity-time"><%= time_ago_in_words(blob.created_at) %> ago</span>
|
109
|
+
<span class="activity-time"><%= time_ago_in_words(blob.created_at, locale: :en) %> ago</span>
|
110
110
|
<span class="activity-size"><%= format_bytes(blob.byte_size) %></span>
|
111
111
|
</div>
|
112
112
|
<div class="activity-actions">
|
@@ -179,7 +179,7 @@
|
|
179
179
|
<% end %>
|
180
180
|
</div>
|
181
181
|
<div class="file-info">
|
182
|
-
<h3 class="file-name" title="<%= blob.filename %>"><%= blob.filename %></h3>
|
182
|
+
<h3 class="file-name" title="<%= blob.filename %>"><%= truncate(blob.filename.to_s, length: 30) %></h3>
|
183
183
|
<div class="file-meta">
|
184
184
|
<span class="file-size"><%= format_bytes(blob.byte_size) %></span>
|
185
185
|
<span class="file-date"><%= blob.created_at.strftime('%Y-%m-%d %H:%M') %></span>
|
@@ -690,17 +690,26 @@
|
|
690
690
|
|
691
691
|
// Animate progress bars on scroll
|
692
692
|
const progressBars = document.querySelectorAll('.progress-fill');
|
693
|
+
// Track which progress bars have already been animated
|
694
|
+
const animatedBars = new Set();
|
693
695
|
|
694
696
|
const animateProgressBars = () => {
|
695
|
-
progressBars.forEach(bar => {
|
697
|
+
progressBars.forEach((bar, index) => {
|
696
698
|
const rect = bar.getBoundingClientRect();
|
697
699
|
const isVisible = (rect.top <= window.innerHeight && rect.bottom >= 0);
|
698
700
|
|
699
|
-
if (isVisible) {
|
700
|
-
|
701
|
+
if (isVisible && !animatedBars.has(index)) {
|
702
|
+
// Store the target width
|
703
|
+
const targetWidth = bar.style.width;
|
704
|
+
// Set initial width to 0
|
701
705
|
bar.style.width = '0%';
|
706
|
+
// Add to our set of animated bars
|
707
|
+
animatedBars.add(index);
|
708
|
+
|
709
|
+
// Animate to target width
|
702
710
|
setTimeout(() => {
|
703
|
-
bar.style.
|
711
|
+
bar.style.transition = 'width 0.8s ease-out';
|
712
|
+
bar.style.width = targetWidth;
|
704
713
|
}, 100);
|
705
714
|
}
|
706
715
|
});
|
@@ -709,7 +718,7 @@
|
|
709
718
|
// Initial animation
|
710
719
|
animateProgressBars();
|
711
720
|
|
712
|
-
// Animate on scroll
|
721
|
+
// Animate on scroll, but only for newly visible bars
|
713
722
|
window.addEventListener('scroll', animateProgressBars);
|
714
723
|
});
|
715
724
|
</script>
|