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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
776d70d1
Commit
776d70d1
authored
Jan 06, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use #html_safe instead of #raw in some diff views. #3945
parent
795ecb49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/views/projects/blob/diff.html.haml
app/views/projects/blob/diff.html.haml
+1
-1
app/views/projects/diffs/_parallel_view.html.haml
app/views/projects/diffs/_parallel_view.html.haml
+2
-2
app/views/projects/diffs/_text_file.html.haml
app/views/projects/diffs/_text_file.html.haml
+2
-2
No files found.
app/views/projects/blob/diff.html.haml
View file @
776d70d1
...
...
@@ -11,7 +11,7 @@
%td
.old_line.diff-line-num
{
data:
{
linenumber:
line_old
}}
=
link_to
raw
(
line_old
),
"#"
%td
.new_line
=
link_to
raw
(
line_new
)
,
"#"
%td
.line_content.noteable_line
=
raw
(
"
#{
' '
*
@form
.
indent
}#{
line
}
"
)
%td
.line_content.noteable_line
=
"
#{
' '
*
@form
.
indent
}#{
line
}
"
.
html_safe
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
%tr
.line_holder
{
id:
@form
.
to
}
...
...
app/views/projects/diffs/_parallel_view.html.haml
View file @
776d70d1
...
...
@@ -20,7 +20,7 @@
=
link_to
raw
(
line_number_left
),
"#
#{
line_code_left
}
"
,
id:
line_code_left
-
if
@comments_allowed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
line_code_left
,
'old'
)
%td
.line_content
{
class:
"parallel noteable_line #{type_left} #{line_code_left}"
,
"line_code"
=>
line_code_left
}=
raw
(
line_content_left
)
%td
.line_content
{
class:
"parallel noteable_line #{type_left} #{line_code_left}"
,
"line_code"
=>
line_code_left
}=
line_content_left
.
html_safe
-
if
type_right
==
'new'
-
new_line_class
=
'new'
...
...
@@ -33,7 +33,7 @@
=
link_to
raw
(
line_number_right
),
"#
#{
new_line_code
}
"
,
id:
new_line_code
-
if
@comments_allowed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
line_code_right
,
'new'
)
%td
.line_content.parallel
{
class:
"noteable_line #{new_line_class} #{new_line_code}"
,
"line_code"
=>
new_line_code
}=
raw
(
line_content_right
)
%td
.line_content.parallel
{
class:
"noteable_line #{new_line_class} #{new_line_code}"
,
"line_code"
=>
new_line_code
}=
line_content_right
.
html_safe
-
if
@reply_allowed
-
comments_left
,
comments_right
=
organize_comments
(
type_left
,
type_right
,
line_code_left
,
line_code_right
)
...
...
app/views/projects/diffs/_text_file.html.haml
View file @
776d70d1
...
...
@@ -21,8 +21,8 @@
-
if
@comments_allowed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
line_code
)
%td
.new_line
{
data:
{
linenumber:
line
.
new_pos
}}
=
link_to
raw
(
type
==
"old"
?
" "
:
line
.
new_pos
)
,
"#
#{
line_code
}
"
,
id:
line_code
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
raw
(
diff_line_content
(
line
.
text
))
=
link_to
raw
(
type
==
"old"
?
" "
:
line
.
new_pos
),
"#
#{
line_code
}
"
,
id:
line_code
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
"line_code"
=>
line_code
}=
diff_line_content
(
line
.
text
).
html_safe
-
if
@reply_allowed
-
comments
=
@line_notes
.
select
{
|
n
|
n
.
line_code
==
line_code
&&
n
.
active?
}.
sort_by
(
&
:created_at
)
...
...
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