summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-15 13:58:15 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-17 09:40:41 +0200
commit87f082de455c784a6beb5d7005a564cfbf8c6bf9 (patch)
tree4d79500c5f1831ca92073e66b78d2b713430d419 /app
parent36ba84cb94dd377a9995b5cdaba9021974fc0489 (diff)
downloadgitlab-ce-87f082de455c784a6beb5d7005a564cfbf8c6bf9.tar.gz
Frontend to send template name instead of on/off
The params were not getting a value other than `project_templates:"on"` so the backend wasn't sure what template to use. Fixes gitlab-org/gitlab-ce#36492
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb2
-rw-r--r--app/views/projects/_project_templates.html.haml2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 1d24563a6a6..150bd591f21 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -28,7 +28,7 @@ class ProjectsController < Projects::ApplicationController
end
def create
- @project = ::Projects::CreateService.new(current_user, project_params).execute
+ @project = ::Projects::CreateService.new(current_user, project_params.merge(template_name: params[:template_name])).execute
if @project.saved?
cookies[:issue_board_welcome_hidden] = { path: project_path(@project), value: nil, expires: Time.at(0) }
diff --git a/app/views/projects/_project_templates.html.haml b/app/views/projects/_project_templates.html.haml
index 21baf35f2ac..97cf13df070 100644
--- a/app/views/projects/_project_templates.html.haml
+++ b/app/views/projects/_project_templates.html.haml
@@ -5,6 +5,6 @@
Blank
- Gitlab::ProjectTemplate.all.each do |template|
.btn
- %input{ type: "radio", autocomplete: "off", name: "project_templates", id: template.name }
+ %input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name }
= custom_icon(template.logo)
= template.title