Commit 0a18081d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add more UI to browse maven packages [ci skip]

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 5f681af8
......@@ -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
......
- @no_container = true
- page_title "Packages"
%table.table
%thead
%tr
%th Name
%th Version
%th Type
%th Created at
%div{ class: container_class }
%table.table
%thead
%tbody
- @packages.each do |package|
%tr
%th ID
%th Name
%th Version
%th Files
%th Created at
%td
= link_to package.name, project_package_path(@project, package)
%td
= package.version
%td
= _('Maven package')
%td
= package.created_at
%tbody
- @packages.each do |package|
%tr
%td
= package.id
%td
= package.name
%td
= package.version
%td
%ul.content-list
- package.package_files.each do |package_file|
%li
= package_file.file.identifier
%td
= package.created_at
= paginate @packages, theme: "gitlab"
- 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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment