Commit 438f0915 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Use partials instead of simple switch case:

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7617#note_18745137
parent bf8c7dc3
%a{href: pipeline_build_url(pipeline, build), style: "color:#3777b0;text-decoration:none;"}
= build.name
Build #<%= build.id %> ( <%= pipeline_build_url(@pipeline, build) %> )
...@@ -158,12 +158,7 @@ ...@@ -158,12 +158,7 @@
%td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;"} %td{style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;"}
= build.stage = build.stage
%td{align: "right", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;"} %td{align: "right", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;"}
- case build = render "notify/#{build.to_partial_path}", pipeline: @pipeline, build: build
- when Ci::Build
%a{href: pipeline_build_url(@pipeline, build), style: "color:#3777b0;text-decoration:none;"}
= build.name
- when GenericCommitStatus
= build.name
%tr.build-log %tr.build-log
- if build.has_trace? - if build.has_trace?
%td{colspan: "2", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 0 15px;"} %td{colspan: "2", style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 0 15px;"}
......
...@@ -19,7 +19,7 @@ Commit Author: <%= commit.author_name %> ...@@ -19,7 +19,7 @@ Commit Author: <%= commit.author_name %>
Pipeline #<%= @pipeline.id %> ( <%= pipeline_url(@pipeline) %> ) had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>. Pipeline #<%= @pipeline.id %> ( <%= pipeline_url(@pipeline) %> ) had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>.
<% failed.each do |build| -%> <% failed.each do |build| -%>
Build #<%= build.id %><%= if build.kind_of?(Ci::Build) then " ( #{pipeline_build_url(@pipeline, build)} )" end %> <%= render "notify/#{build.to_partial_path}", pipeline: @pipeline, build: build %>
Stage: <%= build.stage %> Stage: <%= build.stage %>
Name: <%= build.name %> Name: <%= build.name %>
<% if build.has_trace? -%> <% if build.has_trace? -%>
......
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