Replacing all uses of the old enterprise shop url helper

This commit is contained in:
Rob Harrington
2015-01-16 12:57:48 +11:00
parent 39889390ef
commit 3ec3441cfa
8 changed files with 12 additions and 14 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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)

View File

@@ -23,8 +23,8 @@
-# Shop URL
-# %td &nbsp;
-# %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 &nbsp;
-# %tr

View File

@@ -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

View File

@@ -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?

View File

@@ -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

View File

@@ -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