Add templates for Emails on push
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
0b59af49cb
commit
8b89ef8639
|
@ -16,7 +16,7 @@ module Emails
|
|||
|
||||
def repository_push_email(project_id, recipient, branch, compare)
|
||||
@project = Project.find project_id
|
||||
@commits = compare.commits
|
||||
@commits = Commit.decorate compare.commits
|
||||
@commit = compare.commit
|
||||
@diffs = compare.diffs
|
||||
@branch = branch
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
%h3 New push to #{@branch} at #{@project.name_with_namespace}
|
||||
|
||||
%h4 Commits:
|
||||
|
||||
%ul
|
||||
- @commits.each do |commit|
|
||||
%li
|
||||
#{commit.short_id} - #{commit.title}
|
||||
|
||||
%h4 Diff:
|
||||
- @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} → #{diff.new_path}
|
||||
- else
|
||||
= diff.new_path || diff.old_path
|
||||
%hr
|
||||
%pre
|
||||
= diff.diff
|
||||
%br
|
|
@ -0,0 +1,20 @@
|
|||
New push to #{@branch} at #{@project.name_with_namespace}
|
||||
|
||||
\
|
||||
Commits:
|
||||
- @commits.each do |commit|
|
||||
#{commit.short_id} - #{truncate(commit.title, length: 40)}
|
||||
\
|
||||
\
|
||||
Diff:
|
||||
- @diffs.each do |diff|
|
||||
\
|
||||
\=====================================
|
||||
- if diff.old_path == diff.new_path
|
||||
= diff.new_path
|
||||
- elsif diff.new_path && diff.old_path
|
||||
#{diff.old_path} → #{diff.new_path}
|
||||
- else
|
||||
= diff.new_path || diff.old_path
|
||||
\=====================================
|
||||
= diff.diff
|
Loading…
Reference in New Issue