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
0a18081d
Commit
0a18081d
authored
Jul 30, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more UI to browse maven packages [ci skip]
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5f681af8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
27 deletions
+89
-27
app/controllers/projects/packages/packages_controller.rb
app/controllers/projects/packages/packages_controller.rb
+14
-1
app/views/projects/packages/packages/index.html.haml
app/views/projects/packages/packages/index.html.haml
+18
-25
app/views/projects/packages/packages/show.html.haml
app/views/projects/packages/packages/show.html.haml
+56
-0
config/routes/project.rb
config/routes/project.rb
+1
-1
No files found.
app/controllers/projects/packages/packages_controller.rb
View file @
0a18081d
...
...
@@ -4,7 +4,20 @@ module Projects
before_action
:authorize_admin_project!
def
index
@packages
=
project
.
packages
.
all
@packages
=
project
.
packages
.
all
.
page
(
params
[
:page
])
end
def
show
@package
=
project
.
packages
.
find
(
params
[
:id
])
@package_files
=
@package
.
package_files
.
recent
@maven_metadatum
=
@package
.
maven_metadatum
end
def
destroy
@package
=
project
.
packages
.
find
(
params
[
:id
])
@package
.
destroy
redirect_to
project_packages_path
(
@project
),
notice:
_
(
'Package was removed'
)
end
end
end
...
...
app/views/projects/packages/packages/index.html.haml
View file @
0a18081d
-
@no_container
=
true
-
page_title
"Packages"
%div
{
class:
container_class
}
%table
.table
%table
.table
%thead
%tr
%th
ID
%th
Name
%th
Version
%th
Files
%th
Type
%th
Created at
%tbody
-
@packages
.
each
do
|
package
|
%tr
%td
=
package
.
id
%td
=
package
.
name
=
link_to
package
.
name
,
project_package_path
(
@project
,
package
)
%td
=
package
.
version
%td
%ul
.content-list
-
package
.
package_files
.
each
do
|
package_file
|
%li
=
package_file
.
file
.
identifier
=
_
(
'Maven package'
)
%td
=
package
.
created_at
=
paginate
@packages
,
theme:
"gitlab"
app/views/projects/packages/packages/show.html.haml
0 → 100644
View file @
0a18081d
-
add_to_breadcrumbs
_
(
"Packages"
),
project_packages_path
(
@project
)
-
add_to_breadcrumbs
@package
.
name
,
project_packages_path
(
@project
)
-
breadcrumb_title
@package
.
version
-
page_title
"Packages"
.detail-page-header
.detail-page-header-body
.detail-page-header-actions
-
if
can?
(
current_user
,
:admin_project
,
@project
)
=
link_to
project_package_path
(
@project
,
@package
),
method: :delete
,
data:
{
confirm:
_
(
"Are you sure?"
)
},
class:
"btn btn-grouped btn-inverted btn-remove"
,
title:
_
(
'Delete Package'
)
do
=
_
(
'Delete'
)
.row.prepend-top-default
.col-md-6
.card
.card-header
Package info:
%ul
.content-list
%li
%span
.light
Name:
%strong
=
@package
.
name
%li
%span
.light
Version:
%strong
=
@package
.
version
%li
%span
.light
Created at:
%strong
=
@package
.
created_at
-
if
@maven_metadatum
.card
.card-header
Maven Package info:
%ul
.content-list
%li
%span
.light
App group:
%strong
=
@maven_metadatum
.
app_group
%li
%span
.light
App name:
%strong
=
@maven_metadatum
.
app_name
%li
%span
.light
App version:
%strong
=
@maven_metadatum
.
app_version
.col-md-6
.card
.card-header
Package files:
%ul
.content-list
-
@package_files
.
each
do
|
package_file
|
%li
=
package_file
.
file
.
identifier
.pull-right.text-muted
=
package_file
.
created_at
config/routes/project.rb
View file @
0a18081d
...
...
@@ -311,7 +311,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get
'archive/*id'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
,
id:
/.+?/
},
to:
'repositories#archive'
,
as:
'archive'
## EE-specific
resources
:packages
,
only:
:index
,
module:
'packages'
resources
:packages
,
only:
[
:index
,
:show
,
:destroy
]
,
module:
'packages'
## EE-specific
resources
:jobs
,
only:
[
:index
,
:show
],
constraints:
{
id:
/\d+/
}
do
...
...
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