mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Split dashboard into single and multiple enterprise views
This commit is contained in:
@@ -4,6 +4,13 @@ Spree::Admin::OverviewController.class_eval do
|
||||
@enterprises = Enterprise.managed_by(spree_current_user).order('is_primary_producer ASC, name')
|
||||
@product_count = Spree::Product.active.managed_by(spree_current_user).count
|
||||
@order_cycle_count = OrderCycle.active.managed_by(spree_current_user).count
|
||||
|
||||
if spree_current_user.manages_one_enterprise?
|
||||
@enterprise = @enterprises.first
|
||||
render partial: "single_enterprise_dashboard"
|
||||
else
|
||||
render partial: "multi_enterprise_dashboard"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user