36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
<div>
|
|
<%= form_for(:digital, :url => admin_product_digitals_path(@product), :method => :create, :multipart => true ) do |f| %>
|
|
<fieldset>
|
|
<legend><%= Spree::Variant.model_name.human %> "<%= variant.options_text %>"</legend>
|
|
|
|
<%= f.field_container :current_file do %>
|
|
<strong><%=Spree.t 'files' %>:</strong>
|
|
<% if variant.digital? %>
|
|
<ul>
|
|
<% variant.digitals.each do |digital| %>
|
|
<li>
|
|
<%= render digital %>
|
|
<%= link_to Spree.t(:delete_file), admin_product_digital_url(@product, digital), :confirm => Spree.t(:delete_file_cofirmation, :filename => digital.attachment_file_name), :method => :delete %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% else %>
|
|
<%=Spree.t 'none' %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<p class="form-buttons">
|
|
<%= f.field_container :file do %>
|
|
<%= f.label :file, Spree.t("new_file") %> <span class="required">*</span><br/>
|
|
<%= f.file_field :attachment %>
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag 'digital[variant_id]', variant.id %>
|
|
|
|
<%= button Spree.t('spree_digital.upload') %>
|
|
</p>
|
|
|
|
</fieldset>
|
|
<% end %>
|
|
</div>
|