mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Sort enterprises by name, display direct-from-the-farm links separately at top
This commit is contained in:
@@ -41,7 +41,7 @@ class EnterprisesController < BaseController
|
||||
@products = []
|
||||
|
||||
if @enterprise.is_primary_producer
|
||||
@distributors = Enterprise.distributing_any_product_of(@enterprise.supplied_products)
|
||||
@distributors = Enterprise.distributing_any_product_of(@enterprise.supplied_products).by_name.all
|
||||
end
|
||||
|
||||
if current_order_cycle
|
||||
|
||||
@@ -11,5 +11,8 @@
|
||||
%p.hint Select a hub to start shopping:
|
||||
|
||||
%ul#supplier-distributors
|
||||
- if @distributors.delete @enterprise
|
||||
%li= link_to "Buy direct from the farm", shop_enterprise_path(@enterprise), {class: temp_landing_page_distributor_link_class(@enterprise)}
|
||||
|
||||
- @distributors.each do |distributor|
|
||||
%li= link_to distributor.name, shop_enterprise_path(distributor), {class: temp_landing_page_distributor_link_class(distributor)}
|
||||
|
||||
Reference in New Issue
Block a user