Commit 8000fb44 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'file-mode-changed' into 'master'

Show file mode changes on commit page

## Before:

![Screenshot 2014-06-14 22.55.18](https://dev.gitlab.org/uploads/dzaporozhets/gitlabhq/3f89dfa841/Screenshot_2014-06-14_22.55.18.png)

## After:

![Screenshot 2014-06-14 22.54.11](https://dev.gitlab.org/uploads/dzaporozhets/gitlabhq/5e7550d595/Screenshot_2014-06-14_22.54.11.png)
parents b48bb4a7 d29bb23a
...@@ -164,7 +164,7 @@ GEM ...@@ -164,7 +164,7 @@ GEM
multi_json multi_json
gitlab-grack (2.0.0.pre) gitlab-grack (2.0.0.pre)
rack (~> 1.5.1) rack (~> 1.5.1)
gitlab-grit (2.6.8) gitlab-grit (2.6.9)
charlock_holmes (~> 0.6) charlock_holmes (~> 0.6)
diff-lcs (~> 1.1) diff-lcs (~> 1.1)
mime-types (~> 1.15) mime-types (~> 1.15)
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
> span { > span {
font-family: $monospace_font; font-family: $monospace_font;
font-size: 14px;
line-height: 2; line-height: 2;
} }
...@@ -19,9 +18,7 @@ ...@@ -19,9 +18,7 @@
float: right; float: right;
.btn { .btn {
background-color: #EEE; background-color: #FFF;
color: #666;
font-weight: bolder;
} }
} }
...@@ -32,6 +29,7 @@ ...@@ -32,6 +29,7 @@
.file-mode { .file-mode {
font-family: $monospace_font; font-family: $monospace_font;
margin-left: 10px;
} }
} }
.diff-content { .diff-content {
...@@ -51,6 +49,11 @@ ...@@ -51,6 +49,11 @@
} }
} }
.file-mode-changed {
padding: 10px;
color: #777;
}
table { table {
width: 100%; width: 100%;
font-family: $monospace_font; font-family: $monospace_font;
......
...@@ -216,4 +216,8 @@ module CommitsHelper ...@@ -216,4 +216,8 @@ module CommitsHelper
link_to(text.html_safe, user_path(user), options) link_to(text.html_safe, user_path(user), options)
end end
end end
def diff_file_mode_changed?(diff)
diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
end
end end
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
.files .files
- unless @suppress_diff - unless @suppress_diff
- diffs.each_with_index do |diff, i| - diffs.each_with_index do |diff, i|
- next if diff.diff.empty?
- file = project.repository.blob_at(@commit.id, diff.new_path) - file = project.repository.blob_at(@commit.id, diff.new_path)
- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file - file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
- next unless file - next unless file
...@@ -58,7 +57,7 @@ ...@@ -58,7 +57,7 @@
%span.commit-short-id= @commit.short_id(6) %span.commit-short-id= @commit.short_id(6)
- else - else
%span= diff.new_path %span= diff.new_path
- if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode - if diff_file_mode_changed?(diff)
%span.file-mode= "#{diff.a_mode}#{diff.b_mode}" %span.file-mode= "#{diff.a_mode}#{diff.b_mode}"
.diff-btn-group .diff-btn-group
......
...@@ -22,3 +22,6 @@ ...@@ -22,3 +22,6 @@
- unless comments.empty? - unless comments.empty?
= render "projects/notes/diff_notes_with_reply", notes: comments, line: line = render "projects/notes/diff_notes_with_reply", notes: comments, line: line
- if diff.diff.blank? && diff_file_mode_changed?(diff)
.file-mode-changed
File mode changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment