Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
86d29506
Commit
86d29506
authored
Aug 02, 2018
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary if clause and move logic to optional partial
parent
069b2a8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
34 deletions
+35
-34
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+34
-32
app/views/projects/pipelines/show.html.haml
app/views/projects/pipelines/show.html.haml
+1
-2
No files found.
app/views/projects/pipelines/_info.html.haml
View file @
86d29506
-
commit
=
local_assigns
.
fetch
(
:commit
)
-
if
@commit
.
present?
-
return
unless
commit
&
.
present?
.commit-box
%h3
.commit-title
=
markdown
(
@commit
.
title
,
pipeline: :single_line
)
-
if
@commit
.
description
.
present?
.commit-description
<
=
preserve
(
markdown
(
@commit
.
description
,
pipeline: :single_line
))
.info-well
.commit-box
-
if
@commit
.
status
%h3
.commit-title
.well-segment.pipeline-info
=
markdown
(
commit
.
title
,
pipeline: :single_line
)
.icon-container
-
if
commit
.
description
.
present?
=
icon
(
'clock-o'
)
.commit-description
<
=
pluralize
@pipeline
.
total_size
,
"job"
=
preserve
(
markdown
(
commit
.
description
,
pipeline: :single_line
))
-
if
@pipeline
.
ref
from
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
-
if
@pipeline
.
duration
in
=
time_interval_in_words
(
@pipeline
.
duration
)
-
if
@pipeline
.
queued_duration
=
"(queued for
#{
time_interval_in_words
(
@pipeline
.
queued_duration
)
}
)"
.well-segment.branch-info
.info-well
.icon-container.commit-icon
-
if
commit
.
status
=
custom_icon
(
"icon_commit"
)
.well-segment.pipeline-info
=
link_to
@commit
.
short_id
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha js-details-short"
.icon-container
=
link_to
(
"#"
,
class:
"js-details-expand d-none d-sm-none d-md-inline"
)
do
=
icon
(
'clock-o'
)
%span
.text-expander
=
pluralize
@pipeline
.
total_size
,
"job"
=
sprite_icon
(
'ellipsis_h'
,
size:
12
)
-
if
@pipeline
.
ref
%span
.js-details-content.hide
from
=
link_to
@pipeline
.
sha
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha commit-hash-full"
=
link_to
@pipeline
.
ref
,
project_ref_path
(
@project
,
@pipeline
.
ref
),
class:
"ref-name"
=
clipboard_button
(
text:
@pipeline
.
sha
,
title:
"Copy commit SHA to clipboard"
)
-
if
@pipeline
.
duration
in
=
time_interval_in_words
(
@pipeline
.
duration
)
-
if
@pipeline
.
queued_duration
=
"(queued for
#{
time_interval_in_words
(
@pipeline
.
queued_duration
)
}
)"
=
render_if_exists
"projects/pipelines/info_extension"
,
pipeline:
@pipeline
.well-segment.branch-info
.icon-container.commit-icon
=
custom_icon
(
"icon_commit"
)
=
link_to
commit
.
short_id
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha js-details-short"
=
link_to
(
"#"
,
class:
"js-details-expand d-none d-sm-none d-md-inline"
)
do
%span
.text-expander
=
sprite_icon
(
'ellipsis_h'
,
size:
12
)
%span
.js-details-content.hide
=
link_to
@pipeline
.
sha
,
project_commit_path
(
@project
,
@pipeline
.
sha
),
class:
"commit-sha commit-hash-full"
=
clipboard_button
(
text:
@pipeline
.
sha
,
title:
"Copy commit SHA to clipboard"
)
=
render_if_exists
"projects/pipelines/info_extension"
,
pipeline:
@pipeline
app/views/projects/pipelines/show.html.haml
View file @
86d29506
...
@@ -7,8 +7,7 @@
...
@@ -7,8 +7,7 @@
#js-pipeline-header-vue
.pipeline-header-container
#js-pipeline-header-vue
.pipeline-header-container
-
if
@commit
=
render
"projects/pipelines/info"
,
commit:
@pipeline
.
commit
=
render
"projects/pipelines/info"
=
render
"projects/pipelines/with_tabs"
,
pipeline:
@pipeline
=
render
"projects/pipelines/with_tabs"
,
pipeline:
@pipeline
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment