Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c68e3f77
Commit
c68e3f77
authored
Jul 15, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render images in help pages.
parent
e4cd0c93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
app/controllers/help_controller.rb
app/controllers/help_controller.rb
+5
-1
config/routes.rb
config/routes.rb
+1
-0
features/steps/help.rb
features/steps/help.rb
+1
-1
No files found.
app/controllers/help_controller.rb
View file @
c68e3f77
...
...
@@ -5,8 +5,12 @@ class HelpController < ApplicationController
def
show
@category
=
params
[
:category
]
@file
=
params
[
:file
]
format
=
params
[
:format
]
||
'md'
file_path
=
Rails
.
root
.
join
(
'doc'
,
@category
,
@file
+
".
#{
format
}
"
)
if
File
.
exists?
(
Rails
.
root
.
join
(
'doc'
,
@category
,
@file
+
'.md'
))
if
%w(png jpg jpeg gif)
.
include?
(
format
)
send_file
file_path
,
disposition:
'inline'
elsif
File
.
exists?
(
file_path
)
render
'show'
else
not_found!
...
...
config/routes.rb
View file @
c68e3f77
...
...
@@ -34,6 +34,7 @@ Gitlab::Application.routes.draw do
get
'help'
=>
'help#index'
get
'help/:category/:file'
=>
'help#show'
,
as: :help_page
get
'help/:category/*file'
=>
'help#show'
get
'help/shortcuts'
#
...
...
features/steps/help.rb
View file @
c68e3f77
...
...
@@ -8,7 +8,7 @@ class Spinach::Features::Help < Spinach::FeatureSteps
end
step
'I visit the "Rake Tasks" help page'
do
visit
help_page_path
(
"raketasks"
,
"maintenance"
)
visit
help_page_path
(
"raketasks"
,
"maintenance
.md
"
)
end
step
'I should see "Rake Tasks" page markdown rendered'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment