Adding download buttons to invoice (orders#show)

This commit is contained in:
Michael Bianco
2012-06-27 09:41:22 -04:00
parent 049770056d
commit 061b6e2e48
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
Deface::Override.new(:virtual_path => "spree/shared/_order_details",
:name => "add_digital_downloads_to_invoice",
:insert_bottom => "td[data-hook='order_item_description']",
:text => %q{
<% if order.state == 'complete' and item.variant.digital? %>
<%= content_tag(:p, :class => 'download_links') do %>
<% item.digital_links.each do |digital_link| %>
<% format = File.extname(digital_link.digital.attachment.path).downcase %>
<%= link_to t(:digital_download, :type => t("digital_format#{format}")), digital_url(:host => Spree::Config.get(:site_url), :secret => digital_link.secret), :class => "btn #{format}" %>
<% end %>
<% end %>
<% end %>
},
:disabled => false)

View File

@@ -6,5 +6,10 @@ en:
broken_file: Warning! this file is broken
delete_file_cofirmation: Are you sure you want to delete the file %{filename}?
digital_delivery: Digital Delivery
digital_download: Download %{type} ↓
digital_format:
mp3: Audio MP3
mobi: Kindle eBook
epub: ePub eBook
spree_digital:
upload: Upload