diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-23 15:00:05 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-23 15:00:05 +0200 |
commit | 0731a7af319e4c19e98a43b7355fa26f5e8bd6f5 (patch) | |
tree | 0b45bd004de1f011528a6baaacf66d1760c73109 /app/controllers/ci | |
parent | aba9668acebd3bc741affc4ff06ca3e75224d66a (diff) | |
download | gitlab-ce-0731a7af319e4c19e98a43b7355fa26f5e8bd6f5.tar.gz |
Show only enabled CI projects
Since CI is enabled by pushing .gitlab-ci.yml file there is no need to
add CI project via dashboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/ci')
-rw-r--r-- | app/controllers/ci/projects_controller.rb | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index 40b61edb0a9..e480c0be907 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -1,11 +1,9 @@ module Ci class ProjectsController < Ci::ApplicationController - PROJECTS_BATCH = 100 - before_action :authenticate_user!, except: [:build, :badge, :index, :show] before_action :authenticate_public_page!, only: :show before_action :project, only: [:build, :integration, :show, :badge, :edit, :update, :destroy, :toggle_shared_runners, :dumped_yaml] - before_action :authorize_access_project!, except: [:build, :badge, :index, :show, :new, :create, :disabled] + before_action :authorize_access_project!, except: [:build, :badge, :index, :show, :new, :disabled] before_action :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners, :dumped_yaml] before_action :authenticate_token!, only: [:build] before_action :no_cache, only: [:badge] @@ -18,14 +16,9 @@ module Ci end def index - @limit, @offset = (params[:limit] || PROJECTS_BATCH).to_i, (params[:offset] || 0).to_i - @page = @offset == 0 ? 1 : (@offset / @limit + 1) - if current_user @projects = ProjectListBuilder.new.execute(current_user, params[:search]) - - @projects = @projects.page(@page).per(@limit) - + @projects = @projects.page(params[:page]).per(40) @total_count = @projects.size end @@ -48,22 +41,6 @@ module Ci def integration end - def create - project_data = OpenStruct.new(JSON.parse(params["project"])) - - unless can?(current_user, :admin_project, ::Project.find(project_data.id)) - return redirect_to ci_root_path, alert: 'You have to have at least master role to enable CI for this project' - end - - @project = Ci::CreateProjectService.new.execute(current_user, project_data) - - if @project.persisted? - redirect_to ci_project_path(@project, show_guide: true), notice: 'Project was successfully created.' - else - redirect_to :back, alert: 'Cannot save project' - end - end - def edit end |