mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Do not show icons for producer-enterprises
Payment and shipping methods don't apply to them.
This commit is contained in:
33
app/views/spree/admin/overview/_enterprise_row.html.haml
Normal file
33
app/views/spree/admin/overview/_enterprise_row.html.haml
Normal file
@@ -0,0 +1,33 @@
|
||||
%a.sixteen.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.edit_admin_enterprise_path(enterprise)}" }
|
||||
%span.five.columns.alpha
|
||||
= enterprise.name
|
||||
%span.symbol.three.columns.centered
|
||||
- if can?(:admin, Spree::PaymentMethod) && enterprise.is_distributor
|
||||
- payment_method_count = enterprise.payment_methods.count
|
||||
- if payment_method_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize payment_method_count, 'payment method'}" }
|
||||
- else
|
||||
%span.icon-remove-sign{ 'ofn-with-tip' => t('.has_no_payment_methods', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.symbol.three.columns.centered
|
||||
- if can?(:admin, Spree::ShippingMethod) && enterprise.is_distributor
|
||||
- shipping_method_count = enterprise.shipping_methods.count
|
||||
- if shipping_method_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize shipping_method_count, 'shipping method'}" }
|
||||
- else
|
||||
%span.icon-remove-sign{ 'ofn-with-tip' => t('.has_no_shipping_methods', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.symbol.three.columns.centered
|
||||
- if can?(:admin, EnterpriseFee) && enterprise.is_distributor
|
||||
- fee_count = enterprise.enterprise_fees.count
|
||||
- if fee_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize fee_count, 'fee'}" }
|
||||
- else
|
||||
%span.icon-warning-sign{ 'ofn-with-tip' => t('.has_no_enterprise_fees', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.two.columns.omega.right
|
||||
%span.icon-arrow-right
|
||||
|
||||
@@ -26,38 +26,7 @@
|
||||
= t "spree_admin_enterprises_fees"
|
||||
%div.sixteen.columns.alpha.list
|
||||
- @enterprises.each do |enterprise|
|
||||
%a.sixteen.columns.alpha.list-item{ class: "#{cycle('odd','even')}", href: "#{main_app.edit_admin_enterprise_path(enterprise)}" }
|
||||
%span.five.columns.alpha
|
||||
= enterprise.name
|
||||
%span.symbol.three.columns.centered
|
||||
- if can? :admin, Spree::PaymentMethod
|
||||
- payment_method_count = enterprise.payment_methods.count
|
||||
- if payment_method_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize payment_method_count, 'payment method'}" }
|
||||
- else
|
||||
%span.icon-remove-sign{ 'ofn-with-tip' => t('.has_no_payment_methods', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.symbol.three.columns.centered
|
||||
- if can? :admin, Spree::ShippingMethod
|
||||
- shipping_method_count = enterprise.shipping_methods.count
|
||||
- if shipping_method_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize shipping_method_count, 'shipping method'}" }
|
||||
- else
|
||||
%span.icon-remove-sign{ 'ofn-with-tip' => t('.has_no_shipping_methods', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.symbol.three.columns.centered
|
||||
- if can? :admin, EnterpriseFee
|
||||
- fee_count = enterprise.enterprise_fees.count
|
||||
- if fee_count > 0
|
||||
%span.icon-ok-sign{ 'ofn-with-tip' => "#{pluralize fee_count, 'fee'}" }
|
||||
- else
|
||||
%span.icon-warning-sign{ 'ofn-with-tip' => t('.has_no_enterprise_fees', enterprise: enterprise.name) }
|
||||
- else
|
||||
|
||||
%span.two.columns.omega.right
|
||||
%span.icon-arrow-right
|
||||
= render 'enterprise_row', { enterprise: enterprise }
|
||||
|
||||
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
|
||||
= t "spree_admin_overview_enterprises_footer"
|
||||
|
||||
Reference in New Issue
Block a user