git-svn-id: https://svn.redmine.org/redmine/trunk@22757 e93f8b46-1217-0410-a6f0-8f06a7374b81pull/149/head
unless lookup_context.exists?(template) | unless lookup_context.exists?(template) | ||||
lang = "en" | lang = "en" | ||||
end | end | ||||
render template: "help/wiki_syntax/#{Setting.text_formatting}/#{lang}/wiki_syntax_#{type}#{Setting.text_formatting}", :layout => nil | |||||
render template: "help/wiki_syntax/#{Setting.text_formatting}/#{lang}/wiki_syntax_#{type}#{Setting.text_formatting}", layout: nil | |||||
end | end | ||||
def show_code_highlighting | def show_code_highlighting | ||||
render template: "help/wiki_syntax/code_highlighting_languages", :layout => nil | |||||
render template: "help/wiki_syntax/code_highlighting_languages", layout: nil | |||||
end | end | ||||
end | end |
get 'robots.:format', :to => 'welcome#robots', :constraints => {:format => 'txt'} | get 'robots.:format', :to => 'welcome#robots', :constraints => {:format => 'txt'} | ||||
get 'help/wiki_syntax/(:type)', :controller => 'help', :action => 'show_wiki_syntax', :constraints => { :type => /detailed/ }, as: 'help_wiki_syntax' | |||||
get 'help/code_highlighting', :controller => 'help', :action => 'show_code_highlighting', as: 'help_code_highlighting' | |||||
get 'help/wiki_syntax/(:type)', :controller => 'help', :action => 'show_wiki_syntax', :constraints => { :type => /detailed/ }, :as => 'help_wiki_syntax' | |||||
get 'help/code_highlighting', :controller => 'help', :action => 'show_code_highlighting', :as => 'help_code_highlighting' | |||||
Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path| | Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path| | ||||
instance_eval(plugin_routes_path.read, plugin_routes_path.to_s) | instance_eval(plugin_routes_path.read, plugin_routes_path.to_s) |
:common_mark => "Wiki Syntax Quick Reference (CommonMark Markdown (GitHub Flavored))" | :common_mark => "Wiki Syntax Quick Reference (CommonMark Markdown (GitHub Flavored))" | ||||
} | } | ||||
formatters.each {|formatter, result| | |||||
formatters.each do |formatter, result| | |||||
with_settings :text_formatting => formatter do | with_settings :text_formatting => formatter do | ||||
get :show_wiki_syntax | get :show_wiki_syntax | ||||
assert_response :success | assert_response :success | ||||
assert_select 'h1', :text => result | assert_select 'h1', :text => result | ||||
end | end | ||||
} | |||||
end | |||||
end | end | ||||
def test_get_help_wiki_syntax_detailed | def test_get_help_wiki_syntax_detailed | ||||
:common_mark => "Wiki formatting (CommonMark Markdown (GitHub Flavored))" | :common_mark => "Wiki formatting (CommonMark Markdown (GitHub Flavored))" | ||||
} | } | ||||
formatters.each {|formatter, result| | |||||
formatters.each do |formatter, result| | |||||
with_settings :text_formatting => formatter do | with_settings :text_formatting => formatter do | ||||
get :show_wiki_syntax, :params => { | get :show_wiki_syntax, :params => { | ||||
:type => 'detailed' | :type => 'detailed' | ||||
assert_response :success | assert_response :success | ||||
assert_select 'h1', :text => result | assert_select 'h1', :text => result | ||||
end | end | ||||
} | |||||
end | |||||
end | end | ||||
def test_get_help_wiki_syntax_should_return_lang_if_available | def test_get_help_wiki_syntax_should_return_lang_if_available |