Use partials instead of simple switch case:
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7617#note_18745137
This commit is contained in:
parent
bf8c7dc3b1
commit
438f0915e7
6 changed files with 7 additions and 7 deletions
2
app/views/notify/ci/builds/_build.html.haml
Normal file
2
app/views/notify/ci/builds/_build.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%a{href: pipeline_build_url(pipeline, build), style: "color:#3777b0;text-decoration:none;"}
|
||||
= build.name
|
1
app/views/notify/ci/builds/_build.text.erb
Normal file
1
app/views/notify/ci/builds/_build.text.erb
Normal file
|
@ -0,0 +1 @@
|
|||
Build #<%= build.id %> ( <%= pipeline_build_url(@pipeline, build) %> )
|
|
@ -0,0 +1 @@
|
|||
= build.name
|
|
@ -0,0 +1 @@
|
|||
Build #<%= build.id %>
|
|
@ -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;"}
|
||||
= 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;"}
|
||||
- case build
|
||||
- when Ci::Build
|
||||
%a{href: pipeline_build_url(@pipeline, build), style: "color:#3777b0;text-decoration:none;"}
|
||||
= build.name
|
||||
- when GenericCommitStatus
|
||||
= build.name
|
||||
= render "notify/#{build.to_partial_path}", pipeline: @pipeline, build: build
|
||||
%tr.build-log
|
||||
- if build.has_trace?
|
||||
%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 %>
|
|||
Pipeline #<%= @pipeline.id %> ( <%= pipeline_url(@pipeline) %> ) had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>.
|
||||
|
||||
<% 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 %>
|
||||
Name: <%= build.name %>
|
||||
<% if build.has_trace? -%>
|
||||
|
|
Loading…
Reference in a new issue