Commit 10ef04d4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add minimal UI for project packages [ci skip]

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c45ecaf9
module Projects
module Packages
class PackagesController < ApplicationController
before_action :authorize_admin_project!
def index
@packages = project.packages.all
end
end
end
end
...@@ -131,6 +131,7 @@ class Project < ActiveRecord::Base ...@@ -131,6 +131,7 @@ class Project < ActiveRecord::Base
has_one :last_event, -> {order 'events.created_at DESC'}, class_name: 'Event' has_one :last_event, -> {order 'events.created_at DESC'}, class_name: 'Event'
has_many :boards, before_add: :validate_board_limit has_many :boards, before_add: :validate_board_limit
has_many :packages, class_name: 'Packages::Package'
# Project services # Project services
has_one :campfire_service has_one :campfire_service
......
- @no_container = true
- page_title "Packages"
%div{ class: container_class }
%table.table
%thead
%tr
%th Name
%th Version
%th Files
%th Created at
%tbody
- @packages.each do |package|
%tr
%td
= package.name
%td
= package.version
%td
%ul
- package.package_files.each do |package_file|
%li
= package_file.file
%td
= package.created_at
- @no_container = true
- page_title "Packages"
%div{ class: container_class }
%table.table
%thead
%tr
%th ID
%th Name
%th Version
%th Files
%th 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
...@@ -310,6 +310,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -310,6 +310,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
scope '-' do scope '-' do
get 'archive/*id', constraints: { format: Gitlab::PathRegex.archive_formats_regex, id: /.+?/ }, to: 'repositories#archive', as: 'archive' get 'archive/*id', constraints: { format: Gitlab::PathRegex.archive_formats_regex, id: /.+?/ }, to: 'repositories#archive', as: 'archive'
## EE-specific
resources :packages, only: :index, module: 'packages'
## EE-specific
resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do
collection do collection do
post :cancel_all post :cancel_all
......
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