mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Inline partials into enterprises view
Now there are no tabs in the dashboard so is pointless to refer to them and to split in multiple partials.
This commit is contained in:
@@ -2,8 +2,63 @@
|
||||
= render 'enterprises_header'
|
||||
|
||||
- if @enterprises.empty?
|
||||
= render 'enterprises_none'
|
||||
%div.sixteen.columns.alpha.list-item.red
|
||||
%span.text.fifteen.columns.alpha
|
||||
= t "spree_admin_enterprises_none_text"
|
||||
%span.one.columns.omega
|
||||
%span.icon-remove-sign
|
||||
%a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" }
|
||||
= t "spree_admin_enterprises_none_create_a_new_enterprise"
|
||||
%span.icon-arrow-right
|
||||
|
||||
- else
|
||||
= render 'enterprises_hubs_tab'
|
||||
= render 'enterprises_footer'
|
||||
%div.sixteen.columns.alpha.list-title
|
||||
%span.five.columns.alpha
|
||||
= t "spree_admin_enterprises_hubs_name"
|
||||
- if can? :admin, Spree::PaymentMethod
|
||||
%span.centered.three.columns
|
||||
= t(:payment_methods)
|
||||
- if can? :admin, Spree::ShippingMethod
|
||||
%span.centered.three.columns
|
||||
= t "spree_admin_enterprises_shipping_methods"
|
||||
- if can? :admin, EnterpriseFee
|
||||
%span.centered.three.columns
|
||||
= t "spree_admin_enterprises_fees"
|
||||
%div.sixteen.columns.alpha.list
|
||||
- @enterprises.is_distributor.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
|
||||
|
||||
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
|
||||
= t "spree_admin_overview_enterprises_footer"
|
||||
%span.icon-arrow-right
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
|
||||
= t "spree_admin_overview_enterprises_footer"
|
||||
%span.icon-arrow-right
|
||||
@@ -1,47 +0,0 @@
|
||||
%div.hubs_tab
|
||||
%div.sixteen.columns.alpha.list-title
|
||||
%span.five.columns.alpha
|
||||
= t "spree_admin_enterprises_hubs_name"
|
||||
- if can? :admin, Spree::PaymentMethod
|
||||
%span.centered.three.columns
|
||||
= t(:payment_methods)
|
||||
- if can? :admin, Spree::ShippingMethod
|
||||
%span.centered.three.columns
|
||||
= t "spree_admin_enterprises_shipping_methods"
|
||||
- if can? :admin, EnterpriseFee
|
||||
%span.centered.three.columns
|
||||
= t "spree_admin_enterprises_fees"
|
||||
%div.sixteen.columns.alpha.list
|
||||
- @enterprises.is_distributor.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
|
||||
@@ -1,8 +0,0 @@
|
||||
%div.sixteen.columns.alpha.list-item.red
|
||||
%span.text.fifteen.columns.alpha
|
||||
= t "spree_admin_enterprises_none_text"
|
||||
%span.one.columns.omega
|
||||
%span.icon-remove-sign
|
||||
%a.sixteen.columns.alpha.button.bottom.red{ href: "#{main_app.new_admin_enterprise_path}" }
|
||||
= t "spree_admin_enterprises_none_create_a_new_enterprise"
|
||||
%span.icon-arrow-right
|
||||
@@ -1,3 +0,0 @@
|
||||
%div.sixteen.columns.alpha.tabs
|
||||
%div.dashboard_tab.eight.columns.alpha.blue{ ng: { class: "{selected: activeTab == 'hubs'}", click: "activeTab = 'hubs'" } }
|
||||
= t "spree_admin_enterprises_tabs_hubs"
|
||||
Reference in New Issue
Block a user