From e61e3eaadb7f0c7c106b72d1325437e7743a2027 Mon Sep 17 00:00:00 2001 From: Job van der Voort Date: Tue, 15 Apr 2014 18:01:54 +0200 Subject: [PATCH 1/9] render readme in help --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/sections/help.scss | 11 +++++ app/views/help/index.html.haml | 54 +++-------------------- 3 files changed, 17 insertions(+), 49 deletions(-) create mode 100644 app/assets/stylesheets/sections/help.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 0b372a87a1..630d2aa429 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -34,6 +34,7 @@ /** * Page specific styles (issues, projects etc): */ + @import "sections/*"; /** diff --git a/app/assets/stylesheets/sections/help.scss b/app/assets/stylesheets/sections/help.scss new file mode 100644 index 0000000000..c888185370 --- /dev/null +++ b/app/assets/stylesheets/sections/help.scss @@ -0,0 +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 diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 724fe1d6b3..8f0db82d47 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -33,53 +33,9 @@ Use = link_to "shortcuts", '#', onclick: "new Shortcuts()" - .col-md-4 - .ui-box - .title - User documentation - %ul.well-list - %li - %strong= link_to "Workflow", help_workflow_path - %p Learn how to use Git and GitLab together. + .col-md-8 + .ui-box.documentation + .title Documentation - %li - %strong= link_to "SSH keys", help_ssh_path - %p Setup secure access to your projects. - - %li - %strong= link_to "GitLab Markdown", help_markdown_path - %p Learn what you can do with GitLab's advanced formatting system. - - %li - %strong= link_to "Permissions", help_permissions_path - %p Get familiar with GitLab's permission levels. - - %li - %strong= link_to "API", help_api_file_path(category: 'README') - %p Explore how you can access GitLab via a simple and powerful API. - - %li - %strong= link_to "Web Hooks", help_web_hooks_path - %p Let GitLab notify you when new code has been pushed to your project. - - .col-md-4 - .ui-box - .title - Admin documentation - %ul.well-list - - %li - %strong= link_to "Rake Tasks", help_raketasks_path - %p Explore what GitLab has in store for you to make administration easier. - - %li - %strong= link_to "System Hooks", help_system_hooks_path - %p Let GitLab notify you when certain management tasks need to be carried out. - - %li - %strong= link_to "Public Access", help_public_access_path - %p Learn how you can allow public access to a project. - - %li - %strong= link_to "Security", help_security_path - %p Learn what you can do to secure your GitLab instance. + = preserve do + = markdown File.read(Rails.root.join("doc", "README.md")) \ No newline at end of file From fd476cf62013e49acf23a301b841e7c09197e9ae Mon Sep 17 00:00:00 2001 From: Job van der Voort Date: Fri, 18 Apr 2014 17:21:21 +0200 Subject: [PATCH 2/9] render items from doc --- app/assets/stylesheets/sections/help.scss | 20 ++++++++++---------- app/controllers/help_controller.rb | 11 +++++++++++ app/views/help/_layout.html.haml | 10 +++++----- app/views/help/index.html.haml | 2 +- app/views/help/show.html.haml | 1 + config/routes.rb | 16 +++------------- 6 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 app/views/help/show.html.haml diff --git a/app/assets/stylesheets/sections/help.scss b/app/assets/stylesheets/sections/help.scss index c888185370..6488e7c1e8 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 051cbdfaf0..a4fcd4b29e 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 201d63ca24..72547ed014 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 8f0db82d47..ca8e17d152 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 0000000000..d7785d307e --- /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 ada9bb1d77..bab8fb1d21 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 From 54ff9d90adc66f88c608b2157789d71b0944590e Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 28 May 2014 14:37:08 +0200 Subject: [PATCH 3/9] Scan the text and add the help path. --- app/views/help/index.html.haml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index ca8e17d152..87fa5ef57d 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -38,4 +38,7 @@ .title Documentation = preserve do - = markdown File.read(Rails.root.join("doc", "README.md")) + - readme_text = File.read(Rails.root.join("doc", "README.md")) + - text = readme_text.dup + - readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") } + = markdown text From 59797b2f2eef559397b53b6a3763c62d40363902 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 28 May 2014 15:18:23 +0200 Subject: [PATCH 4/9] Remove list items styling in show render. --- app/views/help/show.html.haml | 4 +++- doc/workflow/README.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/help/show.html.haml b/app/views/help/show.html.haml index d7785d307e..e9fc6163c7 100644 --- a/app/views/help/show.html.haml +++ b/app/views/help/show.html.haml @@ -1 +1,3 @@ -= markdown File.read(Rails.root.join('doc', @category, @file + '.md')) +.col-md-12 + .documentation + = markdown File.read(Rails.root.join('doc', @category, @file + '.md')) diff --git a/doc/workflow/README.md b/doc/workflow/README.md index efc28d06e7..39b3059e07 100644 --- a/doc/workflow/README.md +++ b/doc/workflow/README.md @@ -1,2 +1,2 @@ -+ [Workflow](workflow/workflow.md) -+ [Project Features](workflow/project_features.md) ++ [Workflow](workflow.md) ++ [Project Features](project_features.md) From a9580a157a39bd6d7bc046f1bada88eb5d698b9c Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 28 May 2014 15:47:03 +0200 Subject: [PATCH 5/9] Use the correct links, replace in search. --- app/helpers/search_helper.rb | 18 +++++++++--------- app/views/help/_layout.html.haml | 6 ------ app/views/projects/_visibility_level.html.haml | 2 +- config/routes.rb | 2 +- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index d7f3da7e53..01c3120569 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -33,15 +33,15 @@ module SearchHelper # Autocomplete results for internal help pages def help_autocomplete [ - { label: "help: API Help", url: help_api_path }, - { label: "help: Markdown Help", url: help_markdown_path }, - { label: "help: Permissions Help", url: help_permissions_path }, - { label: "help: Public Access Help", url: help_public_access_path }, - { label: "help: Rake Tasks Help", url: help_raketasks_path }, - { label: "help: SSH Keys Help", url: help_ssh_path }, - { label: "help: System Hooks Help", url: help_system_hooks_path }, - { label: "help: Web Hooks Help", url: help_web_hooks_path }, - { label: "help: Workflow Help", url: help_workflow_path }, + { label: "help: API Help", url: help_page_path("api", "README") }, + { label: "help: Markdown Help", url: help_page_path("markdown", "markdown") }, + { label: "help: Permissions Help", url: help_page_path("permissions", "permissions") }, + { label: "help: Public Access Help", url: help_page_path("public_access", "public_access") }, + { label: "help: Rake Tasks Help", url: help_page_path("raketasks", "README") }, + { label: "help: SSH Keys Help", url: help_page_path("ssh", "README") }, + { label: "help: System Hooks Help", url: help_page_path("system_hooks", "system_hooks") }, + { label: "help: Web Hooks Help", url: help_page_path("web_hooks", "web_hooks") }, + { label: "help: Workflow Help", url: help_page_path("workflow", "README") }, ] end diff --git a/app/views/help/_layout.html.haml b/app/views/help/_layout.html.haml index 72547ed014..93a746c60e 100644 --- a/app/views/help/_layout.html.haml +++ b/app/views/help/_layout.html.haml @@ -1,12 +1,6 @@ .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 - .col-md-9 .wiki = yield diff --git a/app/views/projects/_visibility_level.html.haml b/app/views/projects/_visibility_level.html.haml index eb38fce0ec..5f34e66b3e 100644 --- a/app/views/projects/_visibility_level.html.haml +++ b/app/views/projects/_visibility_level.html.haml @@ -1,7 +1,7 @@ .form-group.project-visibility-level-holder = f.label :visibility_level, class: 'control-label' do Visibility Level - = link_to "(?)", help_public_access_path + = link_to "(?)", help_page_path("public_access", "public_access") .col-sm-10 - if can_change_visibility_level - Gitlab::VisibilityLevel.values.each do |level| diff --git a/config/routes.rb b/config/routes.rb index bab8fb1d21..38e6727b19 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,7 +33,7 @@ Gitlab::Application.routes.draw do # get 'help' => 'help#index' - get 'help/:category/:file' => 'help#show' + get 'help/:category/:file' => 'help#show', as: :help_page # # Global snippets From f79a300417120bb2bdd5d5b22c8ced42e5c3dab7 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 28 May 2014 15:58:02 +0200 Subject: [PATCH 6/9] Replace existing links to help pages with the new ones. --- app/views/admin/groups/show.html.haml | 2 +- app/views/admin/hooks/index.html.haml | 2 +- app/views/errors/access_denied.html.haml | 2 +- app/views/groups/members.html.haml | 2 +- app/views/profiles/keys/index.html.haml | 2 +- app/views/profiles/keys/new.html.haml | 2 +- app/views/projects/deploy_keys/_form.html.haml | 2 +- app/views/projects/hooks/index.html.haml | 2 +- app/views/projects/issues/_form.html.haml | 2 +- app/views/projects/merge_requests/_form.html.haml | 3 +-- app/views/projects/merge_requests/_new_submit.html.haml | 3 +-- app/views/projects/milestones/_form.html.haml | 2 +- app/views/projects/notes/_form.html.haml | 2 +- app/views/projects/protected_branches/index.html.haml | 4 ++-- app/views/projects/team_members/index.html.haml | 2 +- app/views/projects/wikis/_form.html.haml | 3 +-- features/steps/help.rb | 2 +- 17 files changed, 18 insertions(+), 21 deletions(-) diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 6055865b4c..594762f495 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -51,7 +51,7 @@ .body.form-holder %p.light Read more about project permissions - %strong= link_to "here", help_permissions_path, class: "vlink" + %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink" = form_tag project_teams_update_admin_group_path(@group), id: "new_team_member", class: "bulk_import", method: :put do %div diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 60773c2009..b27523cbf2 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -2,7 +2,7 @@ System hooks %p.light - #{link_to "System hooks ", help_system_hooks_path, class: "vlink"} can be + #{link_to "System hooks ", help_page_path("system_hooks", "system_hooks"), class: "vlink"} can be used for binding events when GitLab creates a User or Project. %hr diff --git a/app/views/errors/access_denied.html.haml b/app/views/errors/access_denied.html.haml index 6aa78f0c2a..e005a7c440 100644 --- a/app/views/errors/access_denied.html.haml +++ b/app/views/errors/access_denied.html.haml @@ -2,4 +2,4 @@ %h3.page-title Access Denied %hr %p You are not allowed to access this page. -%p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"} +%p Read more about project permissions #{link_to "here", help_page_path("permissions", "permissions"), class: "vlink"} diff --git a/app/views/groups/members.html.haml b/app/views/groups/members.html.haml index fa44ee2ae1..cc5eba6437 100644 --- a/app/views/groups/members.html.haml +++ b/app/views/groups/members.html.haml @@ -5,7 +5,7 @@ %p.light Members of group have access to all group projects. Read more about permissions - %strong= link_to "here", help_permissions_path, class: "vlink" + %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink" %hr diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 71a4ca91d4..2e10fa8be8 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -6,7 +6,7 @@ SSH keys allow you to establish a secure connection between your computer and GitLab %br Before you can add an SSH key you need to - = link_to "generate it", help_ssh_path + = link_to "generate it", help_page_path("ssh", "README") %hr diff --git a/app/views/profiles/keys/new.html.haml b/app/views/profiles/keys/new.html.haml index 3d5a947948..126afa5554 100644 --- a/app/views/profiles/keys/new.html.haml +++ b/app/views/profiles/keys/new.html.haml @@ -1,6 +1,6 @@ %h3.page-title Add an SSH Key %p.light - Paste your public key here. Read more about how to generate a key on #{link_to "the SSH help page", help_ssh_path}. + Paste your public key here. Read more about how to generate a key on #{link_to "the SSH help page", help_page_path("ssh", "README")}. %hr = render 'form' diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml index ebb92b36b4..162ef05b36 100644 --- a/app/views/projects/deploy_keys/_form.html.haml +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -14,7 +14,7 @@ .col-sm-10 %p.light Paste a machine public key here. Read more about how to generate it - = link_to "here", help_ssh_path + = link_to "here", help_page_path("ssh", "README") = f.text_area :key, class: "form-control thin_area", rows: 5 .form-actions diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml index 866fd6f606..73171fbe99 100644 --- a/app/views/projects/hooks/index.html.haml +++ b/app/views/projects/hooks/index.html.haml @@ -2,7 +2,7 @@ Web hooks %p.light - #{link_to "Web hooks ", help_web_hooks_path, class: "vlink"} can be + #{link_to "Web hooks ", help_page_path("web_hooks", "web_hooks"), class: "vlink"} can be used for binding events when something is happening within the project. %hr.clearfix diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index 6e61fc8524..120d70eaa6 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -22,7 +22,7 @@ .col-sm-10 = f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 14 .col-sm-12.hint - .pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. .clearfix .error-alert diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index facc6a63f3..27ea53c006 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -24,9 +24,8 @@ .col-sm-10 = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 14 .col-sm-12.hint - .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. - .clearfix .error-alert %hr diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index bf0e40f9a1..bdfa4444ab 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -25,9 +25,8 @@ = f.label :description, "Description" = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 10 .col-sm-12.hint - .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. - .clearfix .error-alert .form-group diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 2233a8838c..9f3e0c44b2 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -23,7 +23,7 @@ .col-sm-10 = f.text_area :description, maxlength: 2000, class: "form-control markdown-area", rows: 10 .hint - .pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Milestones are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}. .pull-left Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. .clearfix .error-alert diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml index 25ebaca930..f6a21f7995 100644 --- a/app/views/projects/notes/_form.html.haml +++ b/app/views/projects/notes/_form.html.haml @@ -17,7 +17,7 @@ = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area' .light.clearfix.hint - .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'} .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. .error-alert .note-preview-holder.hide diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml index e51bf1d3a8..a51a4cc224 100644 --- a/app/views/projects/protected_branches/index.html.haml +++ b/app/views/projects/protected_branches/index.html.haml @@ -5,10 +5,10 @@ .bs-callout.bs-callout-info %p Protected branches designed to %ul - %li prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. + %li prevent push for all except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}. %li prevent branch from force push %li prevent branch from removal - %p Read more about project permissions #{link_to "here", help_permissions_path, class: "underlined-link"} + %p Read more about project permissions #{link_to "here", help_page_path("permissions", "permissions"), class: "underlined-link"} - if can? current_user, :admin_project, @project = form_for [@project, @protected_branch], html: { class: 'form-horizontal' } do |f| diff --git a/app/views/projects/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml index 6eccaafe3d..ddb3b9d4a9 100644 --- a/app/views/projects/team_members/index.html.haml +++ b/app/views/projects/team_members/index.html.haml @@ -10,7 +10,7 @@ %p.light Read more about project permissions - %strong= link_to "here", help_permissions_path, class: "vlink" + %strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink" = render "team", members: @users_projects - if @group = render "group_members" diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 303cec8e98..a0a56b84a1 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -24,9 +24,8 @@ .col-sm-10 = f.text_area :content, class: 'form-control js-gfm-input markdown-area', rows: 18 .col-sm-12.hint - .pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'} .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard. - .clearfix .error-alert .form-group diff --git a/features/steps/help.rb b/features/steps/help.rb index 5ea2c5daee..770aceadb8 100644 --- a/features/steps/help.rb +++ b/features/steps/help.rb @@ -8,7 +8,7 @@ class Spinach::Features::Help < Spinach::FeatureSteps end step 'I visit the "Rake Tasks" help page' do - visit help_raketasks_path + visit help_page_path("raketasks", "README") end step 'I should see "Rake Tasks" page markdown rendered' do From c1551c6ed077a00731e692edc1a7ddb0b1f29ad1 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 29 May 2014 08:36:32 +0200 Subject: [PATCH 7/9] Fix routing tests. --- spec/routing/routing_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index a2d2a35140..7bfd5d0b99 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -79,35 +79,35 @@ describe HelpController, "routing" do end it "to #permissions" do - get("/help/permissions").should route_to('help#permissions') + get("/help/permissions/permissions").should route_to('help#show', category: "permissions", file: "permissions") end it "to #workflow" do - get("/help/workflow").should route_to('help#workflow') + get("/help/workflow/README").should route_to('help#show', category: "workflow", file: "README") end it "to #api" do - get("/help/api").should route_to('help#api') + get("/help/api/README").should route_to('help#show', category: "api", file: "README") end it "to #web_hooks" do - get("/help/web_hooks").should route_to('help#web_hooks') + get("/help/web_hooks/web_hooks").should route_to('help#show', category: "web_hooks", file: "web_hooks") end it "to #system_hooks" do - get("/help/system_hooks").should route_to('help#system_hooks') + get("/help/system_hooks/system_hooks").should route_to('help#show', category: "system_hooks", file: "system_hooks") end it "to #markdown" do - get("/help/markdown").should route_to('help#markdown') + get("/help/markdown/markdown").should route_to('help#show',category: "markdown", file: "markdown") end it "to #ssh" do - get("/help/ssh").should route_to('help#ssh') + get("/help/ssh/README").should route_to('help#show', category: "ssh", file: "README") end it "to #raketasks" do - get("/help/raketasks").should route_to('help#raketasks') + get("/help/raketasks/README").should route_to('help#show', category: "raketasks", file: "README") end end From 0879babfd1224626d0523a66caca0cac44ee9ee8 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 29 May 2014 10:13:30 +0200 Subject: [PATCH 8/9] Fix feature. --- features/steps/help.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/steps/help.rb b/features/steps/help.rb index 770aceadb8..bfb3a38a29 100644 --- a/features/steps/help.rb +++ b/features/steps/help.rb @@ -8,14 +8,14 @@ class Spinach::Features::Help < Spinach::FeatureSteps end step 'I visit the "Rake Tasks" help page' do - visit help_page_path("raketasks", "README") + visit help_page_path("raketasks", "maintenance") end step 'I should see "Rake Tasks" page markdown rendered' do - page.should have_content "GitLab provides some specific rake tasks to enable special features or perform maintenance tasks" + page.should have_content "Gather information about GitLab and the system it runs on" end step 'Header "Rebuild project satellites" should have correct ids and links' do - header_should_have_correct_id_and_link(3, '(Re-)Create satellite repos', 're-create-satellite-repos') + header_should_have_correct_id_and_link(3, '(Re-)Create satellite repos', 're-create-satellite-repos', '.documentation') end end From 17a696a98b8f7a8bbdbcd4bdc3d1500e08ddceaa Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 29 May 2014 12:01:34 +0200 Subject: [PATCH 9/9] We need shortcuts route. --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 38e6727b19..6581aeef11 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -34,6 +34,7 @@ Gitlab::Application.routes.draw do get 'help' => 'help#index' get 'help/:category/:file' => 'help#show', as: :help_page + get 'help/shortcuts' # # Global snippets