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
9497b1a7
Commit
9497b1a7
authored
Jul 05, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compare images
parent
31bc2b94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
app/assets/stylesheets/sections/commits.scss
app/assets/stylesheets/sections/commits.scss
+9
-6
app/views/commits/_diffs.html.haml
app/views/commits/_diffs.html.haml
+8
-2
No files found.
app/assets/stylesheets/sections/commits.scss
View file @
9497b1a7
...
...
@@ -101,18 +101,21 @@
margin
:
50px
;
padding
:
1px
;
max-width
:
400px
;
}
&
.diff_image_removed
{
img
{
&
.diff_image_removed
{
border
:
1px
solid
#C00
;
}
}
&
.diff_image_added
{
img
{
&
.diff_image_added
{
border
:
1px
solid
#0C0
;;
}
}
&
.img_compared
{
img
{
max-width
:
300px
;
}
}
}
}
...
...
app/views/commits/_diffs.html.haml
View file @
9497b1a7
...
...
@@ -35,7 +35,13 @@
-
if
file
.
text?
=
render
"commits/text_file"
,
:diff
=>
diff
,
:index
=>
i
-
elsif
file
.
image?
.diff_file_content_image
{
:class
=>
image_diff_class
(
diff
)}
%img
{
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
-
if
diff
.
renamed_file
||
diff
.
new_file
||
diff
.
deleted_file
.diff_file_content_image
%img
{
:class
=>
image_diff_class
(
diff
),
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
-
else
-
old_file
=
(
@commit
.
prev_commit
.
tree
/
diff
.
old_path
)
.diff_file_content_image.img_compared
%img
{
:class
=>
"diff_image_removed"
,
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"
}
%img
{
:class
=>
"diff_image_added"
,
:src
=>
"data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"
}
-
else
%p
.nothing_here_message
No preview for this file type
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