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
Jérome Perrin
gitlab-ce
Commits
80c86bcc
Commit
80c86bcc
authored
Sep 07, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create shared partial for project and admin builds
parent
27c3a871
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
93 deletions
+46
-93
app/views/admin/builds/_build.html.haml
app/views/admin/builds/_build.html.haml
+0
-80
app/views/admin/builds/index.html.haml
app/views/admin/builds/index.html.haml
+1
-1
app/views/projects/builds/_table.html.haml
app/views/projects/builds/_table.html.haml
+3
-3
app/views/projects/builds/index.html.haml
app/views/projects/builds/index.html.haml
+2
-2
app/views/shared/builds/_build.html.haml
app/views/shared/builds/_build.html.haml
+16
-7
app/views/shared/builds/_tabs.html.haml
app/views/shared/builds/_tabs.html.haml
+24
-0
No files found.
app/views/admin/builds/_build.html.haml
deleted
100644 → 0
View file @
27c3a871
-
project
=
build
.
project
%tr
.build.commit
%td
.status
=
ci_status_with_icon
(
build
.
status
)
%td
.branch-commit
-
if
can?
(
current_user
,
:read_build
,
build
.
project
)
=
link_to
namespace_project_build_url
(
build
.
project
.
namespace
,
build
.
project
,
build
)
do
%span
.build-link
##{build.id}
-
else
%span
.build-link
##{build.id}
-
if
build
.
ref
.icon-container
=
build
.
tag?
?
icon
(
'tag'
)
:
icon
(
'code-fork'
)
=
link_to
build
.
ref
,
namespace_project_commits_path
(
build
.
project
.
namespace
,
build
.
project
,
build
.
ref
),
class:
"monospace branch-name"
-
else
.light
none
.icon-container
=
custom_icon
(
"icon_commit"
)
=
link_to
build
.
short_sha
,
namespace_project_commit_path
(
build
.
project
.
namespace
,
build
.
project
,
build
.
sha
),
class:
"monospace commit-id"
-
if
build
.
stuck?
%i
.fa.fa-warning.text-warning
.label-container
-
if
build
.
tags
.
any?
-
build
.
tags
.
each
do
|
tag
|
%span
.label.label-primary
=
tag
-
if
build
.
try
(
:trigger_request
)
%span
.label.label-info
triggered
-
if
build
.
try
(
:allow_failure
)
%span
.label.label-danger
allowed to fail
%td
-
if
project
=
link_to
project
.
name_with_namespace
,
admin_namespace_project_path
(
project
.
namespace
,
project
)
%td
-
if
build
.
try
(
:runner
)
=
runner_link
(
build
.
runner
)
-
else
.light
none
%td
=
build
.
stage
%td
=
build
.
name
%td
-
if
build
.
duration
%p
.duration
=
custom_icon
(
"icon_timer"
)
=
duration_in_numbers
(
build
.
duration
)
-
if
build
.
finished_at
%p
.finished-at
=
icon
(
"calendar"
)
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
%td
.coverage
-
if
defined?
(
coverage
)
&&
coverage
-
if
build
.
try
(
:coverage
)
#{
build
.
coverage
}
%
%td
.pull-right
-
if
can?
(
current_user
,
:read_build
,
project
)
&&
build
.
artifacts?
=
link_to
download_namespace_project_build_artifacts_path
(
build
.
project
.
namespace
,
build
.
project
,
build
),
title:
'Download artifacts'
,
class:
'btn btn-build'
do
%i
.fa.fa-download
-
if
can?
(
current_user
,
:update_build
,
build
.
project
)
-
if
build
.
active?
=
link_to
cancel_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Cancel'
,
class:
'btn btn-build'
do
%i
.fa.fa-remove.cred
-
elsif
defined?
(
allow_retry
)
&&
allow_retry
&&
build
.
retryable?
=
link_to
retry_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Retry'
,
class:
'btn btn-build'
do
%i
.fa.fa-refresh
app/views/admin/builds/index.html.haml
View file @
80c86bcc
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
.top-area
.top-area
-
build_path
=
->
(
scope
)
{
admin_builds_path
(
scope:
scope
)
}
-
build_path
=
->
(
scope
)
{
admin_builds_path
(
scope:
scope
)
}
=
render
"shared/builds
_
tabs"
,
build_path:
build_path
,
all_builds:
@all_builds
,
scope:
@scope
=
render
"shared/builds
/
tabs"
,
build_path:
build_path
,
all_builds:
@all_builds
,
scope:
@scope
.nav-controls
.nav-controls
-
if
@all_builds
.
running_or_pending
.
any?
-
if
@all_builds
.
running_or_pending
.
any?
...
...
app/views/projects/builds/_table.html.haml
View file @
80c86bcc
-
admin
=
false
unless
admin
-
if
builds
.
blank?
-
if
builds
.
blank?
%li
%li
.nothing-here-block
No builds to show
.nothing-here-block
No builds to show
...
@@ -20,9 +21,8 @@
...
@@ -20,9 +21,8 @@
%th
%th
-
if
admin
-
if
admin
-
builds
.
each
do
|
build
|
=
render
partial:
"shared/builds/build"
,
collection:
builds
,
as: :build
,
locals:
{
commit_sha:
true
,
ref:
true
,
stage:
true
,
allow_retry:
true
,
runner:
true
,
admin:
true
}
=
render
"admin/builds/build"
,
build:
build
-
else
-
else
=
render
builds
,
commit_sha:
true
,
ref:
true
,
stage:
true
,
allow_retry:
true
,
coverage:
project
.
build_coverage_enabled?
=
render
partial:
"shared/builds/build"
,
collection:
builds
,
as: :build
,
locals:
{
commit_sha:
true
,
ref:
true
,
stage:
true
,
allow_retry:
true
,
coverage:
project
.
build_coverage_enabled?
}
=
paginate
builds
,
theme:
'gitlab'
=
paginate
builds
,
theme:
'gitlab'
app/views/projects/builds/index.html.haml
View file @
80c86bcc
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
%div
{
class:
container_class
}
%div
{
class:
container_class
}
.top-area
.top-area
-
build_path
=
->
(
scope
)
{
project_builds_path
(
@project
,
scope:
scope
)
}
-
build_path
=
->
(
scope
)
{
project_builds_path
(
@project
,
scope:
scope
)
}
=
render
"shared/builds
_
tabs"
,
build_path:
build_path
,
all_builds:
@all_builds
,
scope:
@scope
=
render
"shared/builds
/
tabs"
,
build_path:
build_path
,
all_builds:
@all_builds
,
scope:
@scope
.nav-controls
.nav-controls
-
if
can?
(
current_user
,
:update_build
,
@project
)
-
if
can?
(
current_user
,
:update_build
,
@project
)
...
@@ -20,4 +20,4 @@
...
@@ -20,4 +20,4 @@
%span
CI Lint
%span
CI Lint
%ul
.content-list.builds-content-list
%ul
.content-list.builds-content-list
=
render
"table"
,
builds:
@builds
,
project:
@project
,
admin:
false
=
render
"table"
,
builds:
@builds
,
project:
@project
app/views/
projects/ci
/builds/_build.html.haml
→
app/views/
shared
/builds/_build.html.haml
View file @
80c86bcc
-
admin
=
false
unless
admin
-
if
admin
-
project
=
build
.
project
%tr
.build.commit
%tr
.build.commit
%td
.status
%td
.status
-
if
can?
(
current_user
,
:read_build
,
build
)
-
if
can?
(
current_user
,
:read_build
,
build
)
...
@@ -9,9 +13,9 @@
...
@@ -9,9 +13,9 @@
.branch-commit
.branch-commit
-
if
can?
(
current_user
,
:read_build
,
build
)
-
if
can?
(
current_user
,
:read_build
,
build
)
=
link_to
namespace_project_build_url
(
build
.
project
.
namespace
,
build
.
project
,
build
)
do
=
link_to
namespace_project_build_url
(
build
.
project
.
namespace
,
build
.
project
,
build
)
do
%span
##{build.id}
%span
.build-link
##{build.id}
-
else
-
else
%span
##{build.id}
%span
.build-link
##{build.id}
-
if
defined?
(
ref
)
&&
ref
-
if
defined?
(
ref
)
&&
ref
-
if
build
.
ref
-
if
build
.
ref
...
@@ -45,6 +49,11 @@
...
@@ -45,6 +49,11 @@
-
if
build
.
manual?
-
if
build
.
manual?
%span
.label.label-info
manual
%span
.label.label-info
manual
-
if
admin
%td
-
if
project
=
link_to
project
.
name_with_namespace
,
admin_namespace_project_path
(
project
.
namespace
,
project
)
-
if
defined?
(
runner
)
&&
runner
-
if
defined?
(
runner
)
&&
runner
%td
%td
-
if
build
.
try
(
:runner
)
-
if
build
.
try
(
:runner
)
...
@@ -53,8 +62,7 @@
...
@@ -53,8 +62,7 @@
.light
none
.light
none
%td
%td
-
if
defined?
(
stage
)
&&
stage
=
build
.
stage
=
build
.
stage
%td
%td
=
build
.
name
=
build
.
name
...
@@ -64,13 +72,14 @@
...
@@ -64,13 +72,14 @@
%p
.duration
%p
.duration
=
custom_icon
(
"icon_timer"
)
=
custom_icon
(
"icon_timer"
)
=
duration_in_numbers
(
build
.
duration
)
=
duration_in_numbers
(
build
.
duration
)
-
if
build
.
finished_at
-
if
build
.
finished_at
%p
.finished-at
%p
.finished-at
=
icon
(
"calendar"
)
=
icon
(
"calendar"
)
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
-
if
defined?
(
coverage
)
&&
coverage
%td
.
coverage
%td
.
coverage
-
if
defined?
(
coverage
)
&&
coverage
-
if
build
.
try
(
:coverage
)
-
if
build
.
try
(
:coverage
)
#{
build
.
coverage
}
%
#{
build
.
coverage
}
%
...
@@ -87,6 +96,6 @@
...
@@ -87,6 +96,6 @@
-
if
build
.
retryable?
-
if
build
.
retryable?
=
link_to
retry_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Retry'
,
class:
'btn btn-build'
do
=
link_to
retry_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Retry'
,
class:
'btn btn-build'
do
=
icon
(
'repeat'
)
=
icon
(
'repeat'
)
-
elsif
build
.
playable?
-
elsif
build
.
playable?
&&
!
admin
=
link_to
play_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Play'
,
class:
'btn btn-build'
do
=
link_to
play_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
build
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Play'
,
class:
'btn btn-build'
do
=
custom_icon
(
'icon_play'
)
=
custom_icon
(
'icon_play'
)
app/views/shared/builds/_tabs.html.haml
0 → 100644
View file @
80c86bcc
%ul
.nav-links
%li
{
class:
(
'active'
if
scope
.
nil?
)}
=
link_to
build_path
[
nil
]
do
All
%span
.badge.js-totalbuilds-count
=
number_with_delimiter
(
all_builds
.
count
(
:id
))
%li
{
class:
(
'active'
if
scope
==
'pending'
)}
=
link_to
build_path
[
:pending
]
do
Pending
%span
.badge
=
number_with_delimiter
(
all_builds
.
pending
.
count
(
:id
))
%li
{
class:
(
'active'
if
scope
==
'running'
)}
=
link_to
build_path
[
:running
]
do
Running
%span
.badge
=
number_with_delimiter
(
all_builds
.
running
.
count
(
:id
))
%li
{
class:
(
'active'
if
scope
==
'finished'
)}
=
link_to
build_path
[
:finished
]
do
Finished
%span
.badge
=
number_with_delimiter
(
all_builds
.
finished
.
count
(
:id
))
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