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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
end
def
artifacts?
artifacts_file
.
exists?
!
artifacts_expired?
&&
artifacts_file
.
exists?
end
def
artifacts_metadata?
...
...
@@ -352,7 +352,7 @@ module Ci
end
def
artifacts_expired?
!
artifacts?
&&
artifacts_expire_at
&&
artifacts_expire_at
<
Time
.
now
artifacts_expire_at
&&
artifacts_expire_at
<
Time
.
now
end
def
artifacts_expire_in
...
...
app/views/projects/builds/_sidebar.html.haml
View file @
fab1c4a8
...
...
@@ -11,17 +11,28 @@
%p
.build-detail-row
#{
@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
)
}
.title
Build artifacts
.btn-group.btn-group-justified
{
role: :group
}
=
link_to
download_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Download
-
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
#{
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?
=
link_to
browse_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Browse
-
if
@build
.
artifacts_metadata?
=
link_to
browse_namespace_project_build_artifacts_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
do
Browse
.block
{
class:
(
"block-first"
if
!
@build
.
coverage
&&
!
(
can?
(
current_user
,
:read_build
,
@project
)
&&
@build
.
artifacts?
))
}
.title
...
...
@@ -44,16 +55,6 @@
%p
.build-detail-row
%span
.build-light-text
Erased:
#{
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
%span
.build-light-text
Runner:
-
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