Merge pull request #1060 from mchill/custom-template
Fix custom.x path when page-file-dir is not set
This commit is contained in:
@@ -29,7 +29,7 @@ module Precious
|
|||||||
end
|
end
|
||||||
|
|
||||||
def custom_path
|
def custom_path
|
||||||
"#{@base_url}#{@page_dir.nil? ? '' : '/'}#{@page_dir}"
|
"#{@base_url}#{@page_dir.empty? ? '' : '/'}#{@page_dir}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def css # custom css
|
def css # custom css
|
||||||
|
|||||||
+14
-1
@@ -513,10 +513,23 @@ context "Frontend" do
|
|||||||
{ :name => 'user1', :email => 'user1' });
|
{ :name => 'user1', :email => 'user1' });
|
||||||
|
|
||||||
get page
|
get page
|
||||||
assert_match /custom.js/, last_response.body
|
assert_match /"\/custom.js"/, last_response.body
|
||||||
Precious::App.set(:wiki_options, { :js => nil })
|
Precious::App.set(:wiki_options, { :js => nil })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "change custom.css path if page-file-dir is set" do
|
||||||
|
Precious::App.set(:wiki_options, { :css => true, :page_file_dir => 'docs'})
|
||||||
|
page = 'docs/yaycustom'
|
||||||
|
text = 'customized!'
|
||||||
|
|
||||||
|
@wiki.write_page(page, :markdown, text,
|
||||||
|
{ :name => 'user1', :email => 'user1' });
|
||||||
|
|
||||||
|
get page
|
||||||
|
assert_match /"\/docs\/custom.css"/, last_response.body
|
||||||
|
Precious::App.set(:wiki_options, { :css => nil, :page_file_dir => nil })
|
||||||
|
end
|
||||||
|
|
||||||
test "show edit page with header and footer and sidebar of multibyte" do
|
test "show edit page with header and footer and sidebar of multibyte" do
|
||||||
post "/create",
|
post "/create",
|
||||||
:content => 'りんご',
|
:content => 'りんご',
|
||||||
|
|||||||
Reference in New Issue
Block a user