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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
17bd6b13
Commit
17bd6b13
authored
May 15, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #821 from oreofish/showmarkdown
show rendered file if it is .markdown file
parents
e84411ef
465a1951
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
app/views/refs/_tree_file.html.haml
app/views/refs/_tree_file.html.haml
+13
-7
No files found.
app/views/refs/_tree_file.html.haml
View file @
17bd6b13
...
@@ -9,14 +9,20 @@
...
@@ -9,14 +9,20 @@
=
link_to
"raw"
,
blob_project_ref_path
(
@project
,
@ref
,
:path
=>
params
[
:path
]),
:class
=>
"right"
,
:target
=>
"_blank"
=
link_to
"raw"
,
blob_project_ref_path
(
@project
,
@ref
,
:path
=>
params
[
:path
]),
:class
=>
"right"
,
:target
=>
"_blank"
=
link_to
"history"
,
project_commits_path
(
@project
,
:path
=>
params
[
:path
],
:ref
=>
@ref
),
:class
=>
"right"
,
:style
=>
"margin-right:10px;"
=
link_to
"history"
,
project_commits_path
(
@project
,
:path
=>
params
[
:path
],
:ref
=>
@ref
),
:class
=>
"right"
,
:style
=>
"margin-right:10px;"
-
if
file
.
text?
-
if
file
.
text?
.view_file_content
-
if
name
=~
/\.(md|markdown)$/i
-
unless
file
.
empty?
#tree-readme-holder
%div
{
:class
=>
current_user
.
dark_scheme
?
"black"
:
"white"
}
.readme
=
preserve
do
=
preserve
do
=
raw
file
.
colorize
(
options:
{
linenos:
'True'
})
=
markdown
(
file
.
data
)
-
else
-
else
%h3
.view_file_content
%center
Empty file
-
unless
file
.
empty?
%div
{
:class
=>
current_user
.
dark_scheme
?
"black"
:
"white"
}
=
preserve
do
=
raw
file
.
colorize
(
options:
{
linenos:
'True'
})
-
else
%h3
%center
Empty file
-
elsif
file
.
image?
-
elsif
file
.
image?
.view_file_content_image
.view_file_content_image
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
...
...
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