Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-14 23:54:56 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-14 23:54:56 +0400
commitd29bb23a6896c1c660fe27d1a9bd5dbfde94bf52 (patch)
treefb6785c436495ca7f0a94c952725a0d9a3d7212a /app
parentb48bb4a77ceb3fec8a361a6836eb6feba71c84c9 (diff)
Update gitlab-grit to newer version with normal diff collection. Show if file mode was changed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/sections/diff.scss11
-rw-r--r--app/helpers/commits_helper.rb4
-rw-r--r--app/views/projects/commits/_diffs.html.haml3
-rw-r--r--app/views/projects/commits/_text_file.html.haml3
4 files changed, 15 insertions, 6 deletions
diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss
index 24d997c9fca..f4926e2f523 100644
--- a/app/assets/stylesheets/sections/diff.scss
+++ b/app/assets/stylesheets/sections/diff.scss
@@ -11,7 +11,6 @@
> span {
font-family: $monospace_font;
- font-size: 14px;
line-height: 2;
}
@@ -19,9 +18,7 @@
float: right;
.btn {
- background-color: #EEE;
- color: #666;
- font-weight: bolder;
+ background-color: #FFF;
}
}
@@ -32,6 +29,7 @@
.file-mode {
font-family: $monospace_font;
+ margin-left: 10px;
}
}
.diff-content {
@@ -51,6 +49,11 @@
}
}
+ .file-mode-changed {
+ padding: 10px;
+ color: #777;
+ }
+
table {
width: 100%;
font-family: $monospace_font;
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 62aa6832371..4d27cf2851e 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -216,4 +216,8 @@ module CommitsHelper
link_to(text.html_safe, user_path(user), options)
end
end
+
+ def diff_file_mode_changed?(diff)
+ diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
+ end
end
diff --git a/app/views/projects/commits/_diffs.html.haml b/app/views/projects/commits/_diffs.html.haml
index 3d7b5974144..a62f50776fa 100644
--- a/app/views/projects/commits/_diffs.html.haml
+++ b/app/views/projects/commits/_diffs.html.haml
@@ -42,7 +42,6 @@
.files
- unless @suppress_diff
- 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.parent_id, diff.old_path) unless file
- next unless file
@@ -58,7 +57,7 @@
%span.commit-short-id= @commit.short_id(6)
- else
%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}"
.diff-btn-group
diff --git a/app/views/projects/commits/_text_file.html.haml b/app/views/projects/commits/_text_file.html.haml
index 74a68b1bf82..8ced4133294 100644
--- a/app/views/projects/commits/_text_file.html.haml
+++ b/app/views/projects/commits/_text_file.html.haml
@@ -22,3 +22,6 @@
- unless comments.empty?
= 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