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

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
30
    - @message.diffs.each_with_index do |diff, i|
31
      %li.file-stats
32
        %a{href: "#{@message.target_url if @message.disable_diffs?}#diff-#{i}" }
33 34 35 36 37
          - if diff.deleted_file
            %span.deleted-file
              −
              = diff.old_path
          - elsif diff.renamed_file
38
            = diff.old_path
39
            →
40
            = diff.new_path
41 42
          - elsif diff.new_file
            %span.new-file
Steve Norman's avatar
Steve Norman committed
43
              +
44 45
              = diff.new_path
          - else
46
            = diff.new_path
47

48
  - unless @message.disable_diffs?
49
    - diff_files = @message.diffs
50

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
    - if @message.compare_timeout
      %h5 The diff was not included because it is too large.
    - else
      %h4 Changes:
      - diff_files.each_with_index do |diff_file, i|
        %li{id: "diff-#{i}"}
          %a{href: @message.target_url + "#diff-#{i}"}<
            - if diff_file.deleted_file
              %strong<
                = diff_file.old_path
              deleted
            - elsif diff_file.renamed_file
              %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
Douwe Maan's avatar
Douwe Maan committed
75
            - blob = diff_file.blob
76 77
            - if blob && blob.respond_to?(:text?) && blob_text_viewable?(blob)
              %table.code.white
78
                - diff_file.diff_lines.each do |line|
Douwe Maan's avatar
Douwe Maan committed
79
                  = render "projects/diffs/line", line: line, diff_file: diff_file, plain: true
80 81 82
            - else
              No preview for this file type
          %br