Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Don't display download export button if export isn't done yet

Damian Legawiec3f84708ef355
diff --git a/admin/app/views/spree/admin/exports/_export.html.erb b/admin/app/views/spree/admin/exports/_export.html.erb
index d0694e722d..3801ddc8b4 100644
--- a/admin/app/views/spree/admin/exports/_export.html.erb
+++ b/admin/app/views/spree/admin/exports/_export.html.erb
@@ -27,16 +27,16 @@
<% end %>
</td>
<td>
- <%= export.attachment.filename %>
+ <%= export.attachment.filename if export.done? %>
</td>
<td class="w-15"><%= local_time_ago(export.created_at, class: 'with-tip') %></td>
<td>
- <%= number_to_human_size(export.attachment.byte_size) %>
+ <%= number_to_human_size(export.attachment.byte_size) if export.done? %>
</td>
<td class="w-15 text-center">
<%= link_to spree.admin_export_path(export), class: 'btn btn-sm btn-light mx-auto', target: '_blank' do %>
<%= icon 'download', class: 'mr-1' %>
<%= Spree.t(:download) %>
- <% end %>
+ <% end if export.done? %>
</td>
</tr>
\ No newline at end of file