BigW Consortium Gitlab

pipeline_failed_email.html.haml 15.6 KB
Newer Older
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
%html{ lang: "en" }
3
  %head
4 5 6
    %meta{ content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }/
    %meta{ content: "width=device-width, initial-scale=1", name: "viewport" }/
    %meta{ content: "IE=edge", "http-equiv" => "X-UA-Compatible" }/
7
    %title= message.subject
8 9 10 11 12
    :css
      /* CLIENT-SPECIFIC STYLES */
      body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
      table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
      img { -ms-interpolation-mode: bicubic; }
13

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
      /* iOS BLUE LINKS */
      a[x-apple-data-detectors] {
          color: inherit !important;
          text-decoration: none !important;
          font-size: inherit !important;
          font-family: inherit !important;
          font-weight: inherit !important;
          line-height: inherit !important;
      }

      /* ANDROID MARGIN HACK */
      body { margin:0 !important; }
      div[style*="margin: 16px 0"] { margin:0 !important; }

      @media only screen and (max-width: 639px) {
          body, #body {
              min-width: 320px !important;
          }
          table.wrapper {
Lin Jen-Shin committed
33
              width: 100% !important;
34 35 36 37 38 39
              min-width: 320px !important;
          }
          table.wrapper > tbody > tr > td {
              border-left: 0 !important;
              border-right: 0 !important;
              border-radius: 0 !important;
40 41
              padding-left: 10px !important;
              padding-right: 10px !important;
42 43
          }
      }
44 45
  %body{ style: "background-color:#fafafa;margin:0;padding:0;text-align:center;min-width:640px;width:100%;height:100%;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;" }
    %table#body{ border: "0", cellpadding: "0", cellspacing: "0", style: "background-color:#fafafa;margin:0;padding:0;text-align:center;min-width:640px;width:100%;" }
46 47
      %tbody
        %tr.line
48
          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;background-color:#6b4fbb;height:4px;font-size:4px;line-height:4px;" }  
49
        %tr.header
50 51
          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:25px 0;font-size:13px;line-height:1.6;color:#5c5c5c;" }
            %img{ alt: "GitLab", height: "50", src: image_url('mailers/ci_pipeline_notif_v1/gitlab-logo.gif'), width: "55" }/
52
        %tr
53 54
          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;" }
            %table.wrapper{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:640px;margin:0 auto;border-collapse:separate;border-spacing:0;" }
55 56
              %tbody
                %tr
57 58
                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;background-color:#ffffff;text-align:left;padding:18px 25px;border:1px solid #ededed;border-radius:3px;overflow:hidden;" }
                    %table.content{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;border-collapse:separate;border-spacing:0;" }
59 60
                      %tbody
                        %tr.alert
61 62
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:10px;border-radius:3px;font-size:14px;line-height:1.3;text-align:center;overflow:hidden;background-color:#d22f57;color:#ffffff;" }
                            %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;margin:0 auto;" }
63 64
                              %tbody
                                %tr
65 66 67
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;vertical-align:middle;color:#ffffff;text-align:center;padding-right:5px;" }
                                    %img{ alt: "x", height: "13", src: image_url('mailers/ci_pipeline_notif_v1/icon-x-red-inverted.gif'), style: "display:block;", width: "13" }/
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;vertical-align:middle;color:#ffffff;text-align:center;" }
68
                                    Your pipeline has failed.
69
                        %tr.spacer
70
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;height:18px;font-size:18px;line-height:18px;" }
71 72
                            &nbsp;
                        %tr.section
73 74
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 15px;border:1px solid #ededed;border-radius:3px;overflow:hidden;" }
                            %table.info{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;" }
75 76
                              %tbody
                                %tr
77 78
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;" } Project
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;" }
79 80
                                    - namespace_name = @project.group ? @project.group.name : @project.namespace.owner.name
                                    - namespace_url = @project.group ? group_url(@project.group) : user_url(@project.namespace.owner)
81
                                    %a.muted{ href: namespace_url, style: "color:#333333;text-decoration:none;" }
82
                                      = namespace_name
83
                                    \/
84
                                    %a.muted{ href: project_url(@project), style: "color:#333333;text-decoration:none;" }
85 86
                                      = @project.name
                                %tr
87 88 89
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;" } Branch
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;border-top:1px solid #ededed;" }
                                    %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;" }
90 91
                                      %tbody
                                        %tr
92 93 94 95
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
                                            %img{ height: "13", src: image_url('mailers/ci_pipeline_notif_v1/icon-branch-gray.gif'), style: "display:block;", width: "13", alt: "Branch icon" }/
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
                                            %a.muted{ href: commits_url(@pipeline), style: "color:#333333;text-decoration:none;" }
96 97
                                              = @pipeline.ref
                                %tr
98 99 100
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;" } Commit
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;border-top:1px solid #ededed;" }
                                    %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;" }
101 102
                                      %tbody
                                        %tr
103 104 105 106
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
                                            %img{ height: "13", src: image_url('mailers/ci_pipeline_notif_v1/icon-commit-gray.gif'), style: "display:block;", width: "13", alt: "Commit icon" }/
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
                                            %a{ href: commit_url(@pipeline), style: "color:#3777b0;text-decoration:none;" }
107
                                              = @pipeline.short_sha
108 109
                                            - if @merge_request
                                              in
110
                                              %a{ href: merge_request_url(@merge_request), style: "color:#3777b0;text-decoration:none;" }
111
                                                = @merge_request.to_reference
112
                                    .commit{ style: "color:#5c5c5c;font-weight:300;" }
113 114
                                      = @pipeline.git_commit_message.truncate(50)
                                %tr
115 116 117
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;" } Author
                                  %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;color:#333333;font-weight:400;width:75%;padding-left:5px;border-top:1px solid #ededed;" }
                                    %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;" }
118 119
                                      %tbody
                                        %tr
120
                                          - commit = @pipeline.commit
121 122 123
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
                                            %img.avatar{ height: "24", src: avatar_icon(commit.author || commit.author_email, 24), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/
                                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
124
                                            - if commit.author
125
                                              %a.muted{ href: user_url(commit.author), style: "color:#333333;text-decoration:none;" }
126
                                                = commit.author.name
127 128 129
                                            - else
                                              %span
                                                = commit.author_name
130
                        %tr.spacer
131
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;height:18px;font-size:18px;line-height:18px;" }
132 133 134
                            &nbsp;
                        - failed = @pipeline.statuses.latest.failed
                        %tr.pre-section
135
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#333333;font-size:15px;font-weight:400;line-height:1.4;padding:15px 0;" }
136
                            Pipeline
137
                            %a{ href: pipeline_url(@pipeline), style: "color:#3777b0;text-decoration:none;" }
138 139 140 141
                              = "\##{@pipeline.id}"
                            had
                            = failed.size
                            failed
142
                            = "#{'build'.pluralize(failed.size)}."
143
                        %tr.warning
144
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;border:1px solid #ededed;border-bottom:0;border-radius:3px 3px 0 0;overflow:hidden;background-color:#fdf4f6;color:#d22852;font-size:14px;line-height:1.4;text-align:center;padding:8px 15px;" }
145 146
                            Logs may contain sensitive data. Please consider before forwarding this email.
                        %tr.section
147 148
                          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 15px;border:1px solid #ededed;border-radius:3px;overflow:hidden;border-top:0;border-radius:0 0 3px 3px;" }
                            %table.builds{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;border-collapse:collapse;" }
149 150 151
                              %tbody
                                - failed.each do |build|
                                  %tr.build-state
152 153
                                    %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;" }
                                      %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;" }
154 155
                                        %tbody
                                          %tr
156 157 158
                                            %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;padding-right:5px;" }
                                              %img{ alt: "x", height: "10", src: image_url('mailers/ci_pipeline_notif_v1/icon-x-red.gif'), style: "display:block;", width: "10" }/
                                            %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;" }
159
                                              = build.stage
160
                                    %td{ align: "right", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;" }
161
                                      = render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build
162
                                  %tr.build-log
163
                                    - if build.has_trace?
164 165
                                      %td{ colspan: "2", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 0 15px;" }
                                        %pre{ style: "font-family:Monaco,'Lucida Console','Courier New',Courier,monospace;background-color:#fafafa;border-radius:3px;overflow:hidden;white-space:pre-wrap;word-break:break-all;font-size:13px;line-height:1.4;padding:12px;color:#333333;margin:0;" }
166
                                          = build.trace_html(last_lines: 10).html_safe
167
                                    - else
168
                                      %td{ colspan: "2" }
169
        %tr.footer
170 171
          %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:25px 0;font-size:13px;line-height:1.6;color:#5c5c5c;" }
            %img{ alt: "GitLab", height: "33", src: image_url('mailers/ci_pipeline_notif_v1/gitlab-logo-full-horizontal.gif'), style: "display:block;margin:0 auto 1em;", width: "90" }/
172
            %div
173
              %a{ href: profile_notifications_url, style: "color:#3777b0;text-decoration:none;" } Manage all notifications
174
              &middot;
175
              %a{ href: help_url, style: "color:#3777b0;text-decoration:none;" } Help
176 177 178
            %div
              You're receiving this email because of your account on
              = succeed "." do
179
                %a{ href: root_url, style: "color:#3777b0;text-decoration:none;" }= Gitlab.config.gitlab.host