repository_push_email.html.haml 2.75 KB
Newer Older
1
= content_for :head do
2
  = stylesheet_link_tag 'mailers/highlighted_diff_email'
3

4 5 6
%h3
  #{@message.author_name} #{@message.action_name} #{@message.ref_type} #{@message.ref_name}
  at #{link_to(@message.project_name_with_namespace, namespace_project_url(@message.project_namespace, @message.project))}
7

8 9
- if @message.compare
  - if @message.reverse_compare?
10 11 12
    %p
      %strong WARNING:
      The push did not contain any new commits, but force pushed to delete the commits and changes below.
13

14
  %h4
15
    = @message.reverse_compare? ? "Deleted commits:" : "Commits:"
16

17
  %ul
18
    - @message.commits.each do |commit|
19
      %li
20
        %strong= link_to(commit.short_id, namespace_project_commit_url(@message.project_namespace, @message.project, commit))
21 22
        %div
          %span by #{commit.author_name}
23
          %i at #{commit.committed_date.to_s(:iso8601)}
24
        %pre.commit-message
25
          = commit.safe_message
26

27
  %h4 #{pluralize @message.diffs_count, "changed file"}:
28

29
  %ul
Douwe Maan's avatar
Douwe Maan committed
30
    - @message.diffs.each do |diff_file|
31
      %li.file-stats
32 33
        %a{ href: "#{@message.target_url if @message.disable_diffs?}##{hexdigest(diff_file.file_path)}" }
          - if diff_file.deleted_file?
34 35
            %span.deleted-file
              −
36 37 38
              = diff_file.old_path
          - elsif diff_file.renamed_file?
            = diff_file.old_path
39
            →
40 41
            = diff_file.new_path
          - elsif diff_file.new_file?
42
            %span.new-file
43
              +
44
              = diff_file.new_path
45
          - else
46
            = diff_file.new_path
47

48
  - unless @message.disable_diffs?
49 50 51 52
    - if @message.compare_timeout
      %h5 The diff was not included because it is too large.
    - else
      %h4 Changes:
Douwe Maan's avatar
Douwe Maan committed
53
      - @message.diffs.each do |diff_file|
54
        - file_hash = hexdigest(diff_file.file_path)
55 56
        %li{ id: file_hash }
          %a{ href: @message.target_url + "##{file_hash}" }<
57
            - if diff_file.deleted_file?
58 59 60
              %strong<
                = diff_file.old_path
              deleted
61
            - elsif diff_file.renamed_file?
62 63 64 65 66 67 68 69 70 71 72 73
              %strong<
                = diff_file.old_path
              &rarr;
              %strong<
                = diff_file.new_path
            - else
              %strong<
                = diff_file.new_path
          - if diff_file.too_large?
            The diff for this file was not included because it is too large.
          - else
            %hr
74
            - blob = diff_file.blob
Douwe Maan's avatar
Douwe Maan committed
75
            - if blob && blob.readable_text?
76
              %table.code.white
77
                = render partial: "projects/diffs/line", collection: diff_file.highlighted_diff_lines, as: :line, locals: { diff_file: diff_file, plain: true, email: true }
78 79 80
            - else
              No preview for this file type
          %br