summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-20 17:55:23 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-25 13:40:05 +0100
commit7b34c9dc593c15ed60f397b1e43e34bab8702674 (patch)
tree8ac6fb4d472347a8c03624a6db72e21116dccbc2 /app
parent6afb03ee96a2f0c36e69a6da4e10dbe298c5b79f (diff)
downloadgitlab-ce-7b34c9dc593c15ed60f397b1e43e34bab8702674.tar.gz
Add list of changed files to EmailsOnPush.
See #1906.
Diffstat (limited to 'app')
-rw-r--r--app/views/layouts/notify.html.haml9
-rw-r--r--app/views/notify/repository_push_email.html.haml44
-rw-r--r--app/views/notify/repository_push_email.text.haml23
-rw-r--r--app/views/projects/diffs/_stats.html.haml2
4 files changed, 64 insertions, 14 deletions
diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml
index eb5da470160..cd23fd3c280 100644
--- a/app/views/layouts/notify.html.haml
+++ b/app/views/layouts/notify.html.haml
@@ -16,6 +16,15 @@
font-size:small;
color:#777
}
+ .file-stats a {
+ text-decoration: none;
+ }
+ .file-stats .new-file {
+ color: #090;
+ }
+ .file-stats .deleted-file {
+ color: #B00;
+ }
#{add_email_highlight_css}
%body
%div.content
diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml
index a45d1dedcd1..28b87812bcc 100644
--- a/app/views/notify/repository_push_email.html.haml
+++ b/app/views/notify/repository_push_email.html.haml
@@ -11,16 +11,44 @@
%i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")}
%pre #{commit.safe_message}
+%h4 #{pluralize @diffs.count, "changed file"}:
+
+%ul
+ - @diffs.each_with_index do |diff, i|
+ %li.file-stats
+ %a{href: "#diff-#{i}"}
+ - if diff.deleted_file
+ %span.deleted-file
+ &minus;
+ = diff.old_path
+ - elsif diff.renamed_file
+ = diff.old_path
+ &rarr;
+ = diff.new_path
+ - elsif diff.new_file
+ %span.new-file
+ &plus;
+ = diff.new_path
+ - else
+ = diff.new_path
+
%h4 Changes:
-- @diffs.each do |diff|
- %li
- %strong
- - if diff.old_path == diff.new_path
- = diff.new_path
- - elsif diff.new_path && diff.old_path
- #{diff.old_path} &rarr; #{diff.new_path}
+- @diffs.each_with_index do |diff, i|
+ %li{id: "diff-#{i}"}
+ %a{href: @target_url + "#diff-#{i}"}
+ - if diff.deleted_file
+ %strong
+ = diff.old_path
+ deleted
+ - elsif diff.renamed_file
+ %strong
+ = diff.old_path
+ &rarr;
+ %strong
+ = diff.new_path
- else
- = diff.new_path || diff.old_path
+ %strong
+ = diff.new_path
%hr
%pre
= color_email_diff(diff.diff)
diff --git a/app/views/notify/repository_push_email.text.haml b/app/views/notify/repository_push_email.text.haml
index fa355cb5269..8ff7a8a99ea 100644
--- a/app/views/notify/repository_push_email.text.haml
+++ b/app/views/notify/repository_push_email.text.haml
@@ -8,16 +8,29 @@ Commits:
\- - - - -
\
\
+#{pluralize @diffs.count, "changed file"}:
+\
+- @diffs.each do |diff|
+ - if diff.deleted_file
+ \- − #{diff.old_path}
+ - elsif diff.renamed_file
+ \- #{diff.old_path} → #{diff.new_path}
+ - elsif diff.new_file
+ \- + #{diff.new_path}
+ - else
+ \- #{diff.new_path}
+\
+\
Changes:
- @diffs.each do |diff|
\
\=====================================
- - if diff.old_path == diff.new_path
- = diff.new_path
- - elsif diff.new_path && diff.old_path
- #{diff.old_path} &rarr; #{diff.new_path}
+ - if diff.deleted_file
+ #{diff.old_path} deleted
+ - elsif diff.renamed_file
+ #{diff.old_path} → #{diff.new_path}
- else
- = diff.new_path || diff.old_path
+ = diff.new_path
\=====================================
!= diff.diff
\
diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml
index 20e51d18da5..9b5eb84a86d 100644
--- a/app/views/projects/diffs/_stats.html.haml
+++ b/app/views/projects/diffs/_stats.html.haml
@@ -26,7 +26,7 @@
%a{href: "#diff-#{i}"}
%i.fa.fa-minus
= diff.old_path
- \->
+ &rarr;
= diff.new_path
- elsif diff.new_file
%span.new-file