diff --git a/app/assets/stylesheets/sections/help.scss b/app/assets/stylesheets/sections/help.scss index c8881853706ee20989e8e1fc168640f130cdf632..6488e7c1e8e09ca5dbf53d753aa2e892a89957fa 100644 --- a/app/assets/stylesheets/sections/help.scss +++ b/app/assets/stylesheets/sections/help.scss @@ -1,11 +1,11 @@ .documentation { - padding-bottom: 10px; - p { - padding: 10px; - margin: 0; - } - li { - list-style-type: none; - padding-left: 10px; - } -} \ No newline at end of file + padding-bottom: 10px; + p { + padding: 10px; + margin: 0; + } + li { + list-style-type: none; + padding-left: 10px; + } +} diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 051cbdfaf054195badfecd3a5cdcdab50885edf4..a4fcd4b29e82bf88cc460b0d17c9f40cb4f412c4 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -13,6 +13,17 @@ class HelpController < ApplicationController end end + def show + @category = params[:category] + @file = params[:file] + + if File.exists?(Rails.root.join('doc', @category, @file + '.md')) + render 'show' + else + not_found! + end + end + def shortcuts end end diff --git a/app/views/help/_layout.html.haml b/app/views/help/_layout.html.haml index 201d63ca243a374ee3e3ca119783c165753f42c9..72547ed01410d9ac29f34a69b31e47e1a052b42f 100644 --- a/app/views/help/_layout.html.haml +++ b/app/views/help/_layout.html.haml @@ -1,11 +1,11 @@ .row .col-md-3 %h3.page-title Help - %ul.nav.nav-pills.nav-stacked - - links = {:"Workflow" => help_workflow_path, :"SSH Keys" => help_ssh_path, :"GitLab Markdown" => help_markdown_path, :"Permissions" => help_permissions_path, :"API" => help_api_path, :"Web Hooks" => help_web_hooks_path, :"Rake Tasks" => help_raketasks_path, :"System Hooks" => help_system_hooks_path, :"Public Access" => help_public_access_path, :"Security" => help_security_path} - - links.each do |title,path| - %li{class: current_page?(path) ? 'active' : nil} - = link_to title, path + / %ul.nav.nav-pills.nav-stacked + / - links = {:"Workflow" => help_workflow_path, :"SSH Keys" => help_ssh_path, :"GitLab Markdown" => help_markdown_path, :"Permissions" => help_permissions_path, :"API" => help_api_path, :"Web Hooks" => help_web_hooks_path, :"Rake Tasks" => help_raketasks_path, :"System Hooks" => help_system_hooks_path, :"Public Access" => help_public_access_path, :"Security" => help_security_path} + / - links.each do |title,path| + / %li{class: current_page?(path) ? 'active' : nil} + / = link_to title, path .col-md-9 .wiki diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 8f0db82d4738a4157e8c786b8dd32cd80595f544..ca8e17d1527b1a8b0d1625a82e39b13562be8539 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -38,4 +38,4 @@ .title Documentation = preserve do - = markdown File.read(Rails.root.join("doc", "README.md")) \ No newline at end of file + = markdown File.read(Rails.root.join("doc", "README.md")) diff --git a/app/views/help/show.html.haml b/app/views/help/show.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..d7785d307efb794620c82c390bcbf2462f558eca --- /dev/null +++ b/app/views/help/show.html.haml @@ -0,0 +1 @@ += markdown File.read(Rails.root.join('doc', @category, @file + '.md')) diff --git a/config/routes.rb b/config/routes.rb index ada9bb1d77a998d203b5605b4d09e96c3a509914..bab8fb1d2181a8d09574964027eac64581245e16 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,19 +31,9 @@ Gitlab::Application.routes.draw do # # Help # - get 'help' => 'help#index' - get 'help/api' => 'help#api' - get 'help/api/:category' => 'help#api', as: 'help_api_file' - get 'help/markdown' => 'help#markdown' - get 'help/permissions' => 'help#permissions' - get 'help/public_access' => 'help#public_access' - get 'help/raketasks' => 'help#raketasks' - get 'help/ssh' => 'help#ssh' - get 'help/system_hooks' => 'help#system_hooks' - get 'help/web_hooks' => 'help#web_hooks' - get 'help/workflow' => 'help#workflow' - get 'help/shortcuts' - get 'help/security' + + get 'help' => 'help#index' + get 'help/:category/:file' => 'help#show' # # Global snippets