Hide distributors from product details page

This commit is contained in:
Rohan Mitchell
2013-10-31 10:25:57 +11:00
parent 2533e52189
commit 859583992e

View File

@@ -5,24 +5,25 @@
- if @product.supplier - if @product.supplier
%tr.odd %tr.odd
%td= link_to @product.supplier.name, [main_app, @product.supplier] %td= link_to @product.supplier.name, [main_app, @product.supplier]
%br/ - if false
%h6.product-section-title DISTRIBUTORS %br/
%table#product-source.table-display{:width => "100%"} %h6.product-section-title DISTRIBUTORS
%tbody %table#product-source.table-display{:width => "100%"}
- order = current_order(false) %tbody
- validator = DistributionChangeValidator.new(order) - order = current_order(false)
- Enterprise.distributing_product(@product).each do |distributor| - validator = DistributionChangeValidator.new(order)
- if !order.nil? && distributor == order.distributor - Enterprise.distributing_product(@product).each do |distributor|
%tr.odd - if !order.nil? && distributor == order.distributor
%td %tr.odd
%b= link_to(distributor.name, [main_app, distributor]) %td
%td %b= link_to(distributor.name, [main_app, distributor])
%b Current %td
- elsif order.nil? || validator.can_change_to_distributor?(distributor) %b Current
%tr.even - elsif order.nil? || validator.can_change_to_distributor?(distributor)
%td= link_to distributor.name, [main_app, distributor] %tr.even
%td Available %td= link_to distributor.name, [main_app, distributor]
- else %td Available
%tr.even - else
%td= link_to distributor.name, [main_app, distributor] %tr.even
%td %td= link_to distributor.name, [main_app, distributor]
%td