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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fab1c4a8
Commit
fab1c4a8
authored
Jun 10, 2016
by
Kamil Trzcinski
Committed by
Phil Hughes
Jun 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the artifacts expiration prompt in Build Artifacts widget
parent
950d78f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
app/models/ci/build.rb
app/models/ci/build.rb
+2
-2
app/views/projects/builds/_sidebar.html.haml
app/views/projects/builds/_sidebar.html.haml
+18
-17
No files found.
app/models/ci/build.rb
View file @
fab1c4a8
...
@@ -319,7 +319,7 @@ module Ci
...
@@ -319,7 +319,7 @@ module Ci
end
end
def
artifacts?
def
artifacts?
artifacts_file
.
exists?
!
artifacts_expired?
&&
artifacts_file
.
exists?
end
end
def
artifacts_metadata?
def
artifacts_metadata?
...
@@ -352,7 +352,7 @@ module Ci
...
@@ -352,7 +352,7 @@ module Ci
end
end
def
artifacts_expired?
def
artifacts_expired?
!
artifacts?
&&
artifacts_expire_at
&&
artifacts_expire_at
<
Time
.
now
artifacts_expire_at
&&
artifacts_expire_at
<
Time
.
now
end
end
def
artifacts_expire_in
def
artifacts_expire_in
...
...
app/views/projects/builds/_sidebar.html.haml
View file @
fab1c4a8
...
@@ -11,17 +11,28 @@
...
@@ -11,17 +11,28 @@
%p
.build-detail-row
%p
.build-detail-row
#{
@build
.
coverage
}
%
#{
@build
.
coverage
}
%
-
if
can?
(
current_user
,
:read_build
,
@project
)
&&
@build
.
artifacts?
-
if
can?
(
current_user
,
:read_build
,
@project
)
&&
(
@build
.
artifacts?
||
@build
.
artifacts_expired?
)
.block
{
class:
(
"block-first"
if
!
@build
.
coverage
)
}
.block
{
class:
(
"block-first"
if
!
@build
.
coverage
)
}
.title
.title
Build artifacts
Build artifacts
.btn-group.btn-group-justified
{
role: :group
}
-
if
@build
.
artifacts_expired?
=
link_to
download_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
.artifacts-expired.alert.alert-warning
Download
The artifacts were removed
#{
time_ago_with_tooltip
(
@build
.
artifacts_expire_at
)
}
-
elsif
@build
.
artifacts_expire_at
.artifacts-expired.alert.alert-warning
The artifacts will be removed in
#{
time_interval_in_words
(
@build
.
artifacts_expire_in
)
}
-
if
@build
.
artifacts?
.btn-group.btn-group-justified
{
role: :group
}
-
if
@build
.
artifacts_expire_at
=
link_to
keep_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Keep
=
link_to
download_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Download
-
if
@build
.
artifacts_metadata?
-
if
@build
.
artifacts_metadata?
=
link_to
browse_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
=
link_to
browse_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Browse
Browse
.block
{
class:
(
"block-first"
if
!
@build
.
coverage
&&
!
(
can?
(
current_user
,
:read_build
,
@project
)
&&
@build
.
artifacts?
))
}
.block
{
class:
(
"block-first"
if
!
@build
.
coverage
&&
!
(
can?
(
current_user
,
:read_build
,
@project
)
&&
@build
.
artifacts?
))
}
.title
.title
...
@@ -44,16 +55,6 @@
...
@@ -44,16 +55,6 @@
%p
.build-detail-row
%p
.build-detail-row
%span
.build-light-text
Erased:
%span
.build-light-text
Erased:
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
#{
time_ago_with_tooltip
(
@build
.
erased_at
)
}
-
else
-
if
@build
.
artifacts_expired?
.artifacts-expired.alert.alert-warning
The artifacts were removed
#{
time_ago_with_tooltip
(
@build
.
artifacts_expire_at
)
}
-
elsif
@build
.
artifacts_expire_at
.artifacts-expired.alert.alert-warning
The artifacts will be removed in
#{
duration_in_words
(
@build
.
artifacts_expire_at
,
Time
.
now
)
}
.pull-right
=
link_to
keep_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-xs btn-primary'
,
method: :post
do
Keep
%p
.build-detail-row
%p
.build-detail-row
%span
.build-light-text
Runner:
%span
.build-light-text
Runner:
-
if
@build
.
runner
&&
current_user
&&
current_user
.
admin
-
if
@build
.
runner
&&
current_user
&&
current_user
.
admin
...
...
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