diff options
author | Robert Speicher <robert@gitlab.com> | 2018-03-06 01:43:27 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-03-06 01:43:27 +0300 |
commit | 2e87923dcb1cf7984690f5b5fdfc61bddfba923e (patch) | |
tree | b520038f6e5e10d4a5088d6bae17f404306fc30b /app/controllers/projects_controller.rb | |
parent | 4ac0a4bf1001941bfa47b0db6a2eedab1e98a36e (diff) | |
parent | 32d121343d91eea44d1de344b398d30014180da0 (diff) |
Merge branch 'ce-3839-ci-cd-only-projects-fe' into 'master'
Create CI/CD-only projects by URL -- CE backport
See merge request gitlab-org/gitlab-ce!17342
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index af9281e0d02..ee197c75764 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -41,11 +41,11 @@ class ProjectsController < Projects::ApplicationController cookies[:issue_board_welcome_hidden] = { path: project_path(@project), value: nil, expires: Time.at(0) } redirect_to( - project_path(@project), + project_path(@project, custom_import_params), notice: _("Project '%{project_name}' was successfully created.") % { project_name: @project.name } ) else - render 'new', locals: { active_tab: ('import' if project_params[:import_url].present?) } + render 'new', locals: { active_tab: active_new_project_tab } end end @@ -103,7 +103,7 @@ class ProjectsController < Projects::ApplicationController def show if @project.import_in_progress? - redirect_to project_import_path(@project) + redirect_to project_import_path(@project, custom_import_params) return end @@ -359,6 +359,14 @@ class ProjectsController < Projects::ApplicationController ] end + def custom_import_params + {} + end + + def active_new_project_tab + project_params[:import_url].present? ? 'import' : 'blank' + end + def repo_exists? project.repository_exists? && !project.empty_repo? |