Commit 7b34c9dc authored by Douwe Maan's avatar Douwe Maan

Add list of changed files to EmailsOnPush.

See #1906.
parent 6afb03ee
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
font-size:small; font-size:small;
color:#777 color:#777
} }
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
#{add_email_highlight_css} #{add_email_highlight_css}
%body %body
%div.content %div.content
......
...@@ -11,16 +11,44 @@ ...@@ -11,16 +11,44 @@
%i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")} %i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")}
%pre #{commit.safe_message} %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
−
= diff.old_path
- elsif diff.renamed_file
= diff.old_path
→
= diff.new_path
- elsif diff.new_file
%span.new-file
+
= diff.new_path
- else
= diff.new_path
%h4 Changes: %h4 Changes:
- @diffs.each do |diff| - @diffs.each_with_index do |diff, i|
%li %li{id: "diff-#{i}"}
%strong %a{href: @target_url + "#diff-#{i}"}
- if diff.old_path == diff.new_path - if diff.deleted_file
= diff.new_path %strong
- elsif diff.new_path && diff.old_path = diff.old_path
#{diff.old_path} → #{diff.new_path} deleted
- elsif diff.renamed_file
%strong
= diff.old_path
→
%strong
= diff.new_path
- else - else
= diff.new_path || diff.old_path %strong
= diff.new_path
%hr %hr
%pre %pre
= color_email_diff(diff.diff) = color_email_diff(diff.diff)
......
...@@ -8,16 +8,29 @@ Commits: ...@@ -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: Changes:
- @diffs.each do |diff| - @diffs.each do |diff|
\ \
\===================================== \=====================================
- if diff.old_path == diff.new_path - if diff.deleted_file
= diff.new_path #{diff.old_path} deleted
- elsif diff.new_path && diff.old_path - elsif diff.renamed_file
#{diff.old_path} → #{diff.new_path} #{diff.old_path} #{diff.new_path}
- else - else
= diff.new_path || diff.old_path = diff.new_path
\===================================== \=====================================
!= diff.diff != diff.diff
\ \
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
%a{href: "#diff-#{i}"} %a{href: "#diff-#{i}"}
%i.fa.fa-minus %i.fa.fa-minus
= diff.old_path = diff.old_path
\-> →
= diff.new_path = diff.new_path
- elsif diff.new_file - elsif diff.new_file
%span.new-file %span.new-file
......
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