active_storage_dashboard 0.1.3 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65aed8243869ff130f773c0cf62c7a0b8c71793c45f67a295f9fc8f164214005
4
- data.tar.gz: d01b095dfd47ee0e216ec2ef335c0d9d02a68d67a0cc4e2a597ac5863bf2177c
3
+ metadata.gz: 5aed0ae00966171b7c5708ae0231f2c4f84ca19ad7a22741e270f93ccf2502a7
4
+ data.tar.gz: 95a0b2b47e44500724894f746364cf56d462b93a5170e4ec98abdc698b428878
5
5
  SHA512:
6
- metadata.gz: d1137d4817d47dde4f20570eb684bb146423fd00c278bf80a5754c0092908a7b649f26f33e2f447c4c386da1269680d548f6b890dd91a250ccb4b544a347afce
7
- data.tar.gz: 33593efb0dc6a704d8af69c07723c16d72f3f46302fc40ec8a593dbdd75a6393ade2a172881eefa7efc7a0e353b03b440ca0a68fb4b990f7ed0ef7ff9af399a3
6
+ metadata.gz: 4b1e3afdab7ea4b241b87e2378aa01cee383449f817cc968cae35f5a0a30b1082656a78d0ee12b03c956af8fc4ca986e49e57009840893f881eada483794bf41
7
+ data.tar.gz: 529016b918bd05c2eebea22372fd7affec5f784d21524d2d2df00b0bec6e8b21d5522c9c7caa40a06b38e36d9b5d5966ed24b871a156f861ebdef029a872a3df
@@ -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">
@@ -91,7 +91,7 @@
91
91
  </tr>
92
92
  <tr>
93
93
  <th>Filename</th>
94
- <td><%= @blob.filename %></td>
94
+ <td title="<%= @blob.filename %>"><%= truncate(@blob.filename.to_s, length: 100) %></td>
95
95
  </tr>
96
96
  <tr>
97
97
  <th>Content Type</th>
@@ -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) %> •
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr>
58
58
  <th>Filename</th>
59
- <td><%= @blob.filename %></td>
59
+ <td title="<%= @blob.filename %>"><%= truncate(@blob.filename.to_s, length: 100) %></td>
60
60
  </tr>
61
61
  <tr>
62
62
  <th>Content Type</th>
@@ -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
- const width = bar.style.width;
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.width = width;
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>
@@ -30,7 +30,7 @@
30
30
  </tr>
31
31
  <tr>
32
32
  <th>Filename</th>
33
- <td><%= @blob.filename %></td>
33
+ <td title="<%= @blob.filename %>"><%= truncate(@blob.filename.to_s, length: 100) %></td>
34
34
  </tr>
35
35
  <tr>
36
36
  <th>Content Type</th>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_storage_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Panasiti