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
Léo-Paul Géneau
gitlab-ce
Commits
6223a73f
Commit
6223a73f
authored
Feb 04, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6231 from babatakao/markdown-for-snippets-in-projects
Enable markdown formatting for snippets in projects.
parents
c5732658
c52bc838
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
app/views/projects/snippets/_blob.html.haml
app/views/projects/snippets/_blob.html.haml
+2
-6
app/views/snippets/_blob.html.haml
app/views/snippets/_blob.html.haml
+1
-14
app/views/snippets/_blob_content.html.haml
app/views/snippets/_blob_content.html.haml
+14
-0
No files found.
app/views/projects/snippets/_blob.html.haml
View file @
6223a73f
...
...
@@ -6,9 +6,5 @@
.btn-group.tree-btn-group.pull-right
-
if
can?
(
current_user
,
:admin_project_snippet
,
@project
)
||
@snippet
.
author
==
current_user
=
link_to
"Edit"
,
edit_project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-tiny"
,
title:
'Edit Snippet'
=
link_to
"raw"
,
raw_project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-tiny"
,
target:
"_blank"
.file-content.code
-
unless
@snippet
.
content
.
empty?
=
render
'shared/file_hljs'
,
blob:
@snippet
-
else
%p
.nothing_here_message
Empty file
=
link_to
"Raw"
,
raw_project_snippet_path
(
@project
,
@snippet
),
class:
"btn btn-tiny"
,
target:
"_blank"
=
render
'snippets/blob_content'
app/views/snippets/_blob.html.haml
View file @
6223a73f
...
...
@@ -8,17 +8,4 @@
=
link_to
"Edit"
,
edit_snippet_path
(
@snippet
),
class:
"btn btn-tiny"
,
title:
'Edit Snippet'
=
link_to
"Delete"
,
snippet_path
(
@snippet
),
method: :delete
,
data:
{
confirm:
"Are you sure?"
},
class:
"btn btn-tiny"
,
title:
'Delete Snippet'
=
link_to
"Raw"
,
raw_snippet_path
(
@snippet
),
class:
"btn btn-tiny"
,
target:
"_blank"
-
unless
@snippet
.
content
.
empty?
-
if
gitlab_markdown?
(
@snippet
.
file_name
)
.file-content.wiki
=
preserve
do
=
markdown
(
@snippet
.
data
)
-
elsif
markup?
(
@snippet
.
file_name
)
.file-content.wiki
=
render_markup
(
@snippet
.
file_name
,
@snippet
.
data
)
-
else
.file-content.code
=
render
'shared/file_hljs'
,
blob:
@snippet
-
else
.file-content.code
%p
.nothing_here_message
Empty file
=
render
'snippets/blob_content'
app/views/snippets/_blob_content.html.haml
0 → 100644
View file @
6223a73f
-
unless
@snippet
.
content
.
empty?
-
if
gitlab_markdown?
(
@snippet
.
file_name
)
.file-content.wiki
=
preserve
do
=
markdown
(
@snippet
.
data
)
-
elsif
markup?
(
@snippet
.
file_name
)
.file-content.wiki
=
render_markup
(
@snippet
.
file_name
,
@snippet
.
data
)
-
else
.file-content.code
=
render
'shared/file_hljs'
,
blob:
@snippet
-
else
.file-content.code
%p
.nothing_here_message
Empty file
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