mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-09 23:06:06 +00:00
Prefix root_path with main_app so that ofn's route is used. The spree root path will no longer be defined when spree_backend is dropped
This commit is contained in:
@@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
|
||||
referer_path = OpenFoodNetwork::RefererParser.path(request.referer)
|
||||
if referer_path
|
||||
is_checkout_path_the_referer = [main_app.checkout_path].include?(referer_path)
|
||||
session["spree_user_return_to"] = is_checkout_path_the_referer ? referer_path : root_path
|
||||
session["spree_user_return_to"] = is_checkout_path_the_referer ? referer_path : main_app.root_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def after_sign_out_path_for(_resource_or_scope)
|
||||
session[:shopfront_redirect] || root_path
|
||||
session[:shopfront_redirect] || main_app.root_path
|
||||
end
|
||||
|
||||
private
|
||||
@@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def require_distributor_chosen
|
||||
unless @distributor = current_distributor
|
||||
redirect_to spree.root_path
|
||||
redirect_to main_app.root_path
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ module Spree
|
||||
redirect_to '/unauthorized'
|
||||
else
|
||||
store_location
|
||||
redirect_to root_path(anchor: "login?after_login=#{request.env['PATH_INFO']}")
|
||||
redirect_to main_app.root_path(anchor: "login?after_login=#{request.env['PATH_INFO']}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ module Spree
|
||||
@order = order_to_update
|
||||
unless @order
|
||||
flash[:error] = t(:order_not_found)
|
||||
redirect_to(root_path) && return
|
||||
redirect_to(main_app.root_path) && return
|
||||
end
|
||||
|
||||
if @order.update_attributes(params[:order])
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
.row
|
||||
.small-12.medium-3.medium-offset-2.columns.text-left
|
||||
%a{href: root_path}
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.footer_logo.url, width: "220"}
|
||||
.small-12.medium-5.columns.text-left
|
||||
%p.text-small
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
%section.top-bar-section
|
||||
%ul.left
|
||||
%li.ofn-logo
|
||||
%a{href: root_path}
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.logo.url}
|
||||
%li.powered-by
|
||||
%img{src: '/favicon.ico'}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
%section.left
|
||||
.ofn-logo
|
||||
%a{href: root_path}
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}
|
||||
|
||||
%section.right{"ng-cloak" => true}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%aside.left-off-canvas-menu.show-for-medium-down{ ng: { controller: "OffcanvasCtrl" } }
|
||||
%ul.off-canvas-list
|
||||
%li.ofn-logo
|
||||
%a{href: root_path}
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"}
|
||||
- [*1..7].each do |menu_number|
|
||||
- menu_name = "menu_#{menu_number}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%html{ lang: "en" }
|
||||
%head{"data-hook" => "admin_inside_head"}= render :partial => 'spree/admin/shared/head'
|
||||
%body.admin{"data-ajax-root-path" => spree.root_path}
|
||||
%body.admin{"data-ajax-root-path" => main_app.root_path}
|
||||
#wrapper{"data-hook" => ""}
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Spree::Core::ControllerHelpers::Auth.class_eval do
|
||||
def require_login_then_redirect_to(url)
|
||||
redirect_to root_path(anchor: "login?after_login=#{url}")
|
||||
redirect_to main_app.root_path(anchor: "login?after_login=#{url}")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user