Using resource controller and namespace

This commit is contained in:
Michael Gall
2011-12-19 18:46:11 +01:00
committed by future
parent 02fd4a64d1
commit 4ecf99a4ae
21 changed files with 84 additions and 69 deletions
@@ -0,0 +1,5 @@
<% if digital.attachment_file_name.present? %>
<%= digital.attachment_file_name %> (<%= number_to_human_size(digital.attachment_file_size) %>)
<% else %>
<%=t 'broken_file' %>
<% end %>
@@ -0,0 +1,35 @@
<div class="yui-g">
<div class="yui-u first">
<%= form_for(:digital, :url => { :controller => 'digitals', :action => 'create' }, :html => { :multipart => true }) do |f| %>
<fieldset>
<legend><%= Spree::Variant.model_name.human %> "<%= variant.options_text %>"</legend>
<%= f.field_container :current_file do %>
<strong><%=t 'current_file' %>:</strong><br/>
<% if variant.digital? %>
<%= render variant.digital %><%= %>
<% else %>
<%=t 'none' %>
<% end %>
<% end %>
<p class="form-buttons">
<% if variant.digital? %>
<%= link_to t("delete_file"), admin_product_digital_url(:id => variant.digital.id), :confirm => t('delete_file_cofirmation', :filename => variant.digital.attachment_file_name), :method => :delete %>
<% else %>
<%= f.field_container :file do %>
<%= f.label :file, t("new_file") %> <span class="required">*</span><br/>
<%= f.file_field :attachment %>
<% end %>
<%= hidden_field_tag 'digital[variant_id]', variant.id %>
<%= button t("upload") %>
<% end %>
</p>
</fieldset>
<% end %>
</div>
</div><br/>
@@ -0,0 +1,20 @@
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => {:current => "Digital Versions"} %>
<% if @product.has_variants? %>
<% for variant in @product.variants do %>
<%= render 'form', :variant => variant %>
<% end %>
<% else %>
This product has no variants.
<% if @product.master.digital? %>
A digital version of this product currently exists:
<%= render @product.master.digital %>
<% end %>
<%= render 'form', :variant => @product.master %>
<% end %>