diff --git a/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface b/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface index 5d090321f0..a8571d30bb 100644 --- a/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface +++ b/app/overrides/spree/shared/_header/replace_logo_with_link_text.html.haml.deface @@ -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 diff --git a/app/serializers/api/enterprise_serializer.rb b/app/serializers/api/enterprise_serializer.rb index 3e6708b526..95ef4cec60 100644 --- a/app/serializers/api/enterprise_serializer.rb +++ b/app/serializers/api/enterprise_serializer.rb @@ -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. diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index e25060fb14..e42e7038e2 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -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) \ No newline at end of file + = main_app.enterprise_shop_url(@enterprise) \ No newline at end of file diff --git a/app/views/enterprise_mailer/welcome.html.haml b/app/views/enterprise_mailer/welcome.html.haml index 74840fbefa..5c69caae77 100644 --- a/app/views/enterprise_mailer/welcome.html.haml +++ b/app/views/enterprise_mailer/welcome.html.haml @@ -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 diff --git a/app/views/enterprises/show.html.haml b/app/views/enterprises/show.html.haml index 3c672b4cdd..8e5035dbcc 100644 --- a/app/views/enterprises/show.html.haml +++ b/app/views/enterprises/show.html.haml @@ -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 diff --git a/app/views/json/partials/_hub.rabl b/app/views/json/partials/_hub.rabl index ed9520b43e..76c6729b37 100644 --- a/app/views/json/partials/_hub.rabl +++ b/app/views/json/partials/_hub.rabl @@ -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? diff --git a/app/views/shared/_account_sidebar.html.haml b/app/views/shared/_account_sidebar.html.haml index 041ac97765..e572979eb1 100644 --- a/app/views/shared/_account_sidebar.html.haml +++ b/app/views/shared/_account_sidebar.html.haml @@ -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 diff --git a/app/views/shared/_distributor.html.haml b/app/views/shared/_distributor.html.haml index 2712e522a1..ea1eeae0a4 100644 --- a/app/views/shared/_distributor.html.haml +++ b/app/views/shared/_distributor.html.haml @@ -1,3 +1,3 @@ = succeed ',' do - = link_to "#{distributor.name}".html_safe, shop_enterprise_path(distributor), {class: distributor_link_class(distributor)} + = link_to "#{distributor.name}".html_safe, enterprise_shop_path(distributor), {class: distributor_link_class(distributor)} %span.secondary= distributor.city