Skip to content
Snippets Groups Projects
Unverified Commit 3358afa7 authored by Connor Shea's avatar Connor Shea
Browse files

Update the help_page_path route to accept paths directly instead of using parameters.

parent 61f0e894
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 18 deletions
Loading
@@ -31,7 +31,7 @@
Loading
@@ -31,7 +31,7 @@
data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
   
- unless @repository.gitlab_ci_yml - unless @repository.gitlab_ci_yml
= link_to 'Get started with Builds', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info' = link_to 'Get started with Builds', help_page_path('ci/quick_start/README'), class: 'btn btn-info'
   
= link_to ci_lint_path, class: 'btn btn-default' do = link_to ci_lint_path, class: 'btn btn-default' do
%span CI Lint %span CI Lint
Loading
Loading
Loading
@@ -9,5 +9,5 @@
Loading
@@ -9,5 +9,5 @@
.form-group .form-group
%p.light.append-bottom-0 %p.light.append-bottom-0
Paste a machine public key here. Read more about how to generate it Paste a machine public key here. Read more about how to generate it
= link_to "here", help_page_path("ssh", "README") = link_to "here", help_page_path("ssh/README")
= f.submit "Add key", class: "btn-create btn" = f.submit "Add key", class: "btn-create btn"
Loading
@@ -23,7 +23,7 @@
Loading
@@ -23,7 +23,7 @@
.form-group.project-visibility-level-holder .form-group.project-visibility-level-holder
= f.label :visibility_level, class: 'label-light' do = f.label :visibility_level, class: 'label-light' do
Visibility Level Visibility Level
= link_to "(?)", help_page_path("public_access", "public_access") = link_to "(?)", help_page_path("public_access/public_access")
- if can_change_visibility_level?(@project, current_user) - if can_change_visibility_level?(@project, current_user)
= render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project) = render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project)
- else - else
Loading
Loading
Loading
@@ -17,7 +17,7 @@
Loading
@@ -17,7 +17,7 @@
Environments are places where code gets deployed, such as staging or production. Environments are places where code gets deployed, such as staging or production.
%br %br
= succeed "." do = succeed "." do
= link_to "Read more about environments", help_page_path("ci", "environments") = link_to "Read more about environments", help_page_path("ci/environments")
- if can?(current_user, :create_environment, @project) - if can?(current_user, :create_environment, @project)
= link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do
New environment New environment
Loading
Loading
Loading
@@ -7,6 +7,6 @@
Loading
@@ -7,6 +7,6 @@
%p %p
Environments allow you to track deployments of your application Environments allow you to track deployments of your application
= succeed "." do = succeed "." do
= link_to "Read more about environments", help_page_path("ci", "environments") = link_to "Read more about environments", help_page_path("ci/environments")
   
= render 'form' = render 'form'
Loading
@@ -20,7 +20,7 @@
Loading
@@ -20,7 +20,7 @@
Define environments in the deploy stage(s) in Define environments in the deploy stage(s) in
%code .gitlab-ci.yml %code .gitlab-ci.yml
to track deployments here. to track deployments here.
= link_to "Read more", help_page_path("ci", "environments"), class: "btn btn-success" = link_to "Read more", help_page_path("ci/environments"), class: "btn btn-success"
- else - else
.table-holder .table-holder
%table.table.environments %table.table.environments
Loading
Loading
Loading
@@ -107,7 +107,7 @@
Loading
@@ -107,7 +107,7 @@
.form-group.project-visibility-level-holder .form-group.project-visibility-level-holder
= f.label :visibility_level, class: 'label-light' do = f.label :visibility_level, class: 'label-light' do
Visibility Level Visibility Level
= link_to "(?)", help_page_path("public_access", "public_access") = link_to "(?)", help_page_path("public_access/public_access")
= render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project) = render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project)
   
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
Loading
Loading
.comment-toolbar.clearfix .comment-toolbar.clearfix
.toolbar-text .toolbar-text
Styling with Styling with
= link_to 'Markdown', help_page_path('markdown', 'markdown'), target: '_blank', tabindex: -1 = link_to 'Markdown', help_page_path('markdown/markdown'), target: '_blank', tabindex: -1
is supported is supported
%button.toolbar-button.markdown-selector{ type: 'button', tabindex: '-1' } %button.toolbar-button.markdown-selector{ type: 'button', tabindex: '-1' }
= icon('file-image-o', class: 'toolbar-button-icon') = icon('file-image-o', class: 'toolbar-button-icon')
Loading
Loading
Loading
@@ -31,7 +31,7 @@
Loading
@@ -31,7 +31,7 @@
New pipeline New pipeline
   
- unless @repository.gitlab_ci_yml - unless @repository.gitlab_ci_yml
= link_to 'Get started with Pipelines', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info' = link_to 'Get started with Pipelines', help_page_path('ci/quick_start/README'), class: 'btn btn-info'
   
= link_to ci_lint_path, class: 'btn btn-default' do = link_to ci_lint_path, class: 'btn btn-default' do
%span CI Lint %span CI Lint
Loading
Loading
Loading
@@ -12,7 +12,7 @@
Loading
@@ -12,7 +12,7 @@
= select_tag :access_level, options_for_select(ProjectMember.access_level_roles, @project_member.access_level), class: "project-access-select select2" = select_tag :access_level, options_for_select(ProjectMember.access_level_roles, @project_member.access_level), class: "project-access-select select2"
.help-block .help-block
Read more about role permissions Read more about role permissions
%strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink" %strong= link_to "here", help_page_path("permissions/permissions"), class: "vlink"
   
.form-actions .form-actions
= f.submit 'Add users to project', class: "btn btn-create" = f.submit 'Add users to project', class: "btn btn-create"
Loading
@@ -8,10 +8,10 @@
Loading
@@ -8,10 +8,10 @@
%p.prepend-top-20 %p.prepend-top-20
Protected branches are designed to: Protected branches are designed to:
%ul %ul
%li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"} %li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions/permissions"), class: "vlink"}
%li prevent anyone from force pushing to the branch %li prevent anyone from force pushing to the branch
%li prevent anyone from deleting the branch %li prevent anyone from deleting the branch
%p.append-bottom-0 Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"} %p.append-bottom-0 Read more about #{link_to "project permissions", help_page_path("permissions/permissions"), class: "underlined-link"}
.col-lg-9 .col-lg-9
%h5.prepend-top-0 %h5.prepend-top-0
Protect a branch Protect a branch
Loading
Loading
.form-group.project-visibility-level-holder .form-group.project-visibility-level-holder
= f.label :visibility_level, class: 'control-label' do = f.label :visibility_level, class: 'control-label' do
Visibility Level Visibility Level
= link_to "(?)", help_page_path("public_access", "public_access") = link_to "(?)", help_page_path("public_access/public_access")
.col-sm-10 .col-sm-10
- if can_change_visibility_level - if can_change_visibility_level
= render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: visibility_level, form_model: form_model) = render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: visibility_level, form_model: form_model)
Loading
Loading
Loading
@@ -6,7 +6,7 @@
Loading
@@ -6,7 +6,7 @@
%h4.prepend-top-0 %h4.prepend-top-0
= page_title = page_title
%p %p
#{link_to "Webhooks", help_page_path("web_hooks", "web_hooks")} can be #{link_to "Webhooks", help_page_path("web_hooks/web_hooks")} can be
used for binding events when something is happening within the project. used for binding events when something is happening within the project.
.col-lg-9.append-bottom-default .col-lg-9.append-bottom-default
= form_for hook, as: :hook, url: polymorphic_path(url_components + [:hooks]) do |f| = form_for hook, as: :hook, url: polymorphic_path(url_components + [:hooks]) do |f|
Loading
Loading
Loading
@@ -89,9 +89,9 @@ Rails.application.routes.draw do
Loading
@@ -89,9 +89,9 @@ Rails.application.routes.draw do
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put] mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\/(info\/lfs|gitlab-lfs)/.match(request.path_info) }, via: [:get, :post, :put]
   
# Help # Help
get 'help' => 'help#index' get 'help' => 'help#index'
get 'help/:category/:file' => 'help#show', as: :help_page, constraints: { category: /.*/, file: /[^\/\.]+/ } get 'help/*path' => 'help#show', as: :help_page
get 'help/:category/:subcategory/:file' => 'help#show', as: :deep_help_page, constraints: { category: /.*/, subcategory: /.*/, file: /[^\/\.]+/ }
get 'help/shortcuts' get 'help/shortcuts'
get 'help/ui' => 'help#ui' get 'help/ui' => 'help#ui'
   
Loading
Loading
Loading
@@ -8,7 +8,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
Loading
@@ -8,7 +8,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
end end
   
step 'I visit the "Rake Tasks" help page' do step 'I visit the "Rake Tasks" help page' do
visit help_page_path("raketasks", "maintenance") visit help_page_path("raketasks/maintenance")
end end
   
step 'I should see "Rake Tasks" page markdown rendered' do step 'I should see "Rake Tasks" page markdown rendered' do
Loading
Loading
Loading
@@ -6,7 +6,7 @@ describe 'Help Pages', feature: true do
Loading
@@ -6,7 +6,7 @@ describe 'Help Pages', feature: true do
login_as :user login_as :user
end end
it 'replace the variable $your_email with the email of the user' do it 'replace the variable $your_email with the email of the user' do
visit help_page_path('ssh', 'README') visit help_page_path('ssh/README')
expect(page).to have_content("ssh-keygen -t rsa -C \"#{@user.email}\"") expect(page).to have_content("ssh-keygen -t rsa -C \"#{@user.email}\"")
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment