basic suport for subdirectories
This commit is contained in:
parent
fbcda9cdd6
commit
07f868594a
@ -7,7 +7,7 @@
|
||||
= render 'locomotive/shared/actions/contents'
|
||||
|
||||
- content_for :buttons do
|
||||
= local_action_button :show, "/#{@page.fullpath}", :class => 'show'
|
||||
= local_action_button :show, current_site_public_url + '/' + @page.fullpath, :class => 'show'
|
||||
|
||||
%p!= t('.help')
|
||||
|
||||
|
@ -126,6 +126,15 @@ module Locomotive
|
||||
Rails.application.routes.named_routes[:locomotive].path.spec.to_s
|
||||
end
|
||||
|
||||
def self.url_for(path)
|
||||
result = path
|
||||
if config.base_uri
|
||||
result = "#{config.base_uri}/#{path.gsub(%r{^/}, '')}"
|
||||
end
|
||||
result = "/#{result}" if result[0..0] != '/'
|
||||
result
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def self.app_middleware
|
||||
|
@ -9,7 +9,7 @@ module Locomotive
|
||||
end
|
||||
|
||||
def current_site_public_url
|
||||
request.protocol + request.host_with_port
|
||||
request.protocol + request.host_with_port + (Locomotive.config.base_uri || '')
|
||||
end
|
||||
|
||||
def switch_to_site_url(site, options = {})
|
||||
|
@ -13,6 +13,7 @@ module Locomotive
|
||||
:enable_logs => false,
|
||||
:delayed_job => false,
|
||||
:default_locale => :en,
|
||||
:base_uri => nil,
|
||||
:mailer_sender => 'support@example.com',
|
||||
:manage_subdomain => false,
|
||||
:manage_manage_domains => false,
|
||||
|
Loading…
Reference in New Issue
Block a user