Permalink
Browse files

Fixed issue where the digital links section would be shown regardless…

… of if there were digital items. Moved some of the description text to the locale file.
  • Loading branch information...
iloveitaly committed Apr 24, 2012
1 parent 9de9d60 commit ef996cde3148868657fec33464e0d43a58bc6c63
Showing with 8 additions and 3 deletions.
  1. +6 −3 app/views/spree/shared/email/_order_details.html.erb
  2. +2 −0 config/locales/en.yml
@@ -92,18 +92,21 @@
</table>
<% if Rails.application.railties.all.map(&:railtie_name).include? 'spree_digital' %>
+<% digital_items = @order.line_items.select{ |i| i.digital? } %>
+<% unless digital_items.empty? %>
<div class="spacer_15">&nbsp;</div>
<h2><span><%= t(:digital_download_links) %></span></h2>
-<p>Each link will only work a SINGLE TIME! Also, they will only work WITHIN 24 HOURS!</p>
+<p><%= t(:digital_email_description) %></p>
-<% @order.line_items.select{ |i| i.digital? }.each do |item| %>
+<% digital_items.each do |item| %>
<p><%= item.variant.name %>:<br/>
<%
-for link in item.digital_links
+item.digital_links.each do |link|
digital_url = digital_url(:host => Spree::Config.get(:site_url), :secret => link.secret)
%>
<%= link_to digital_url, digital_url%>
</p>
<% end %>
<% end %>
<% end %>
+<% end %>
View
@@ -1,4 +1,6 @@
en:
+ digital_email_description: Each link will only work a SINGLE TIME! Also, they will only work WITHIN 24 HOURS!
+
time:
formats:
short: "%B %d, %Y"

0 comments on commit ef996cd

Please sign in to comment.