mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Replacing all uses of the old enterprise shop url helper
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
%figure#logo.columns.eight
|
||||
- if current_distributor
|
||||
%h1= link_to current_distributor.name, main_app.shop_enterprise_path(current_distributor)
|
||||
%h1= link_to current_distributor.name, main_app.enterprise_shop_path(current_distributor)
|
||||
.change-location= link_to 'Change Location', root_path
|
||||
- else
|
||||
%h1= link_to "OPEN FOOD NETWORK", root_path
|
||||
|
||||
@@ -69,10 +69,8 @@ class Api::CachedEnterpriseSerializer < ActiveModel::Serializer
|
||||
object.promo_image(:large) if object.promo_image.exists?
|
||||
end
|
||||
|
||||
# TODO when ActiveSerializers supports URL helpers
|
||||
# Then refactor. See readme https://github.com/rails-api/active_model_serializers
|
||||
def path
|
||||
"/enterprises/#{object.to_param}/shop"
|
||||
enterprise_shop_path(object)
|
||||
end
|
||||
|
||||
# Map svg icons.
|
||||
|
||||
@@ -72,4 +72,4 @@
|
||||
.with-tip{'data-powertip' => "A direct link to your shopfront on the Open Food Network."}
|
||||
%a What's this?
|
||||
.eight.columns.omega
|
||||
= main_app.shop_enterprise_url(@enterprise)
|
||||
= main_app.enterprise_shop_url(@enterprise)
|
||||
@@ -23,8 +23,8 @@
|
||||
-# Shop URL
|
||||
-# %td
|
||||
-# %td
|
||||
-# %a{:href => "#{ main_app.shop_enterprise_url(@enterprise) }", :target => "_blank"}
|
||||
-# = main_app.shop_enterprise_url(@enterprise)
|
||||
-# %a{:href => "#{ main_app.enterprise_shop_url(@enterprise) }", :target => "_blank"}
|
||||
-# = main_app.enterprise_shop_url(@enterprise)
|
||||
-# %tr
|
||||
-# %td
|
||||
-# %tr
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
%ul#supplier-distributors
|
||||
- if @distributors.delete @enterprise
|
||||
%li= link_to "Buy direct from the farm", shop_enterprise_path(@enterprise), {class: distributor_link_class(@enterprise)}
|
||||
%li= link_to "Buy direct from the farm", enterprise_shop_path(@enterprise), {class: distributor_link_class(@enterprise)}
|
||||
|
||||
- @distributors.each do |distributor|
|
||||
%li= render partial: "shared/distributor", object: distributor
|
||||
|
||||
@@ -5,7 +5,7 @@ child suppliers: :producers do
|
||||
attributes :id
|
||||
end
|
||||
node :path do |enterprise|
|
||||
main_app.shop_enterprise_path(enterprise)
|
||||
main_app.enterprise_shop_path(enterprise)
|
||||
end
|
||||
node :pickup do |hub|
|
||||
hub.shipping_methods.where(:require_ship_address => false).present?
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
-#.row
|
||||
-#.panel
|
||||
-#%p
|
||||
-#%strong= link_to "Manage my account", account_path
|
||||
-#%strong= link_to "Manage my account", account_path
|
||||
-#- if enterprise_user?
|
||||
-#%strong= link_to "Enterprise admin", admin_path
|
||||
-#%strong= link_to "Enterprise admin", admin_path
|
||||
-#- if order = last_completed_order
|
||||
-#%dl
|
||||
-#%dt Current Hub:
|
||||
@@ -13,8 +13,8 @@
|
||||
-#%dt Last hub:
|
||||
-#%dd
|
||||
-#- if order.distributor != current_distributor
|
||||
-#= link_to "#{order.distributor.name}".html_safe, "",
|
||||
-#= link_to "#{order.distributor.name}".html_safe, "",
|
||||
-#{class: distributor_link_class(order.distributor),
|
||||
-#"ng-click" => "emptyCart('#{main_app.shop_enterprise_path(order.distributor)}', $event)"}
|
||||
-#"ng-click" => "emptyCart('#{main_app.enterprise_shop_path(order.distributor)}', $event)"}
|
||||
-#- else
|
||||
-#= order.distributor.name
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
= succeed ',' do
|
||||
= link_to "<strong>#{distributor.name}</strong>".html_safe, shop_enterprise_path(distributor), {class: distributor_link_class(distributor)}
|
||||
= link_to "<strong>#{distributor.name}</strong>".html_safe, enterprise_shop_path(distributor), {class: distributor_link_class(distributor)}
|
||||
%span.secondary= distributor.city
|
||||
|
||||
Reference in New Issue
Block a user