Skip to content

Commit

Permalink
Updated with theme support
Browse files Browse the repository at this point in the history
  • Loading branch information
BDQ committed Dec 18, 2009
1 parent 1a6927e commit cfb4711
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 87 deletions.
53 changes: 0 additions & 53 deletions app/views/admin/shared/_product_tabs.html.erb

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/admin/shared/_vp_product_tab.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if url_options_authenticate?(:controller => 'admin/taxons') %>
<li <%= ' class="active"' if current == "Volume Pricing" %>>
<%= link_to("Volume Pricing", volume_prices_admin_product_variant_url(@product, @product.master)) %>
</li>
<% end %>
17 changes: 17 additions & 0 deletions app/views/admin/variants/_edit_fields.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h3><%= t("volume_prices") %></h3>
<table class="index">
<thead>
<tr>
<th><%= t("display") %></th>
<th><%= t("range") %></th>
<th><%= t("amount") %></th>
<th><%= t("position") %></th>
<th><%= t("action") %></th>
</tr>
</thead>
<tbody id="volume_prices">
<%= f.render_associated_form(@variant.volume_prices) %>
</tbody>
</table>
<%= f.add_associated_link(icon('add') + ' ' + t("add_volume_price"), @variant.volume_prices.build) %>
<br/><br/>
29 changes: 0 additions & 29 deletions app/views/admin/variants/edit.html.erb

This file was deleted.

10 changes: 5 additions & 5 deletions app/views/admin/variants/volume_prices.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%= render :partial => 'admin/shared/product_sub_menu' %>
<%= render :partial => 'admin/shared/product_tabs', :locals => {:current => "Volume Prices"} %>
<%= render :partial => 'admin/shared/product_tabs', :locals => {:current => "Volume Pricing"} %>
<%= error_messages_for :variant %>
<% form_for(:variant, :url => admin_product_variant_url(@product, @variant), :html => { :method => :put }) do |f| %>

<h3><%= t("volume_prices") %></h3>
<table class="index">
<thead>
Expand All @@ -18,11 +18,11 @@
</tr>
</thead>
<tbody id="volume_prices">
<%= f.render_associated_form(@variant.volume_prices) %>
</tbody>
<%= f.render_associated_form(@variant.volume_prices) %>
</tbody>
</table>
<%= f.add_associated_link(icon('add') + ' ' + t("add_volume_price"), @variant.volume_prices.build) %>
<br/><br/>

<%= render :partial => 'admin/shared/edit_resource_links' %>
<% end %>
7 changes: 7 additions & 0 deletions volume_pricing_hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class VolumePricingHooks < Spree::ThemeSupport::HookListener

insert_after :admin_product_tabs, :partial => "admin/shared/vp_product_tab"

insert_after :admin_variant_edit_form, :partial => "admin/variants/edit_fields"

end

0 comments on commit cfb4711

Please sign in to comment.