basic suport for subdirectories
This commit is contained in:
parent
fbcda9cdd6
commit
07f868594a
@ -7,7 +7,7 @@
|
|||||||
= render 'locomotive/shared/actions/contents'
|
= render 'locomotive/shared/actions/contents'
|
||||||
|
|
||||||
- content_for :buttons do
|
- 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')
|
%p!= t('.help')
|
||||||
|
|
||||||
@ -15,4 +15,4 @@
|
|||||||
|
|
||||||
= render 'form', :f => form
|
= render 'form', :f => form
|
||||||
|
|
||||||
= render 'locomotive/shared/form_actions', :back_url => pages_url, :button_label => :update
|
= render 'locomotive/shared/form_actions', :back_url => pages_url, :button_label => :update
|
||||||
|
@ -126,6 +126,15 @@ module Locomotive
|
|||||||
Rails.application.routes.named_routes[:locomotive].path.spec.to_s
|
Rails.application.routes.named_routes[:locomotive].path.spec.to_s
|
||||||
end
|
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
|
protected
|
||||||
|
|
||||||
def self.app_middleware
|
def self.app_middleware
|
||||||
|
@ -9,7 +9,7 @@ module Locomotive
|
|||||||
end
|
end
|
||||||
|
|
||||||
def current_site_public_url
|
def current_site_public_url
|
||||||
request.protocol + request.host_with_port
|
request.protocol + request.host_with_port + (Locomotive.config.base_uri || '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def switch_to_site_url(site, options = {})
|
def switch_to_site_url(site, options = {})
|
||||||
@ -34,4 +34,4 @@ module Locomotive
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,6 +13,7 @@ module Locomotive
|
|||||||
:enable_logs => false,
|
:enable_logs => false,
|
||||||
:delayed_job => false,
|
:delayed_job => false,
|
||||||
:default_locale => :en,
|
:default_locale => :en,
|
||||||
|
:base_uri => nil,
|
||||||
:mailer_sender => 'support@example.com',
|
:mailer_sender => 'support@example.com',
|
||||||
:manage_subdomain => false,
|
:manage_subdomain => false,
|
||||||
:manage_manage_domains => false,
|
:manage_manage_domains => false,
|
||||||
|
Loading…
Reference in New Issue
Block a user