summaryrefslogtreecommitdiff
path: root/app/views/projects/new.html.haml
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-07-26 14:21:53 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-07-28 11:32:46 +0200
commit1d3815f89b9b9f5ecfd6dd15158a2988603b9ed8 (patch)
treea694e1e05f58fc3fe5ae00135d4a439eef7c8150 /app/views/projects/new.html.haml
parentd964816b9fe56679ffc0b331e701f7b24db5c6a9 (diff)
downloadgitlab-ce-1d3815f89b9b9f5ecfd6dd15158a2988603b9ed8.tar.gz
Allow projects to be started from a template
Started implementation for the first iteration of gitlab-org/gitlab-ce#32420. This will allow users to select a template to start with, instead of an empty repository in the project just created. Internally this is basically a small extension of the ImportExport GitLab projects we already support. We just import a certain import tar archive. This commits includes the first one: Ruby on Rails. In the future more will be added.
Diffstat (limited to 'app/views/projects/new.html.haml')
-rw-r--r--app/views/projects/new.html.haml59
1 files changed, 33 insertions, 26 deletions
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index a2d7a21d5f6..c01645e2ec9 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -17,36 +17,17 @@
Create or Import your project from popular Git services
.col-lg-9
= form_for @project, html: { class: 'new_project' } do |f|
- .row
- .form-group.col-xs-12.col-sm-6
- = f.label :namespace_id, class: 'label-light' do
- %span
- Project path
- .form-group
- .input-group
- - if current_user.can_select_namespace?
- .input-group-addon
- = root_url
- = f.select :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), {}, { class: 'select2 js-select-namespace', tabindex: 1}
-
- - else
- .input-group-addon.static-namespace
- #{root_url}#{current_user.username}/
- = f.hidden_field :namespace_id, value: current_user.namespace_id
- .form-group.col-xs-12.col-sm-6.project-path
- = f.label :path, class: 'label-light' do
- %span
- Project name
- = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true
- - if current_user.can_create_group?
- .help-block
- Want to house several dependent projects under the same namespace?
- = link_to "Create a group", new_group_path
+ .project-template.js-toggle-container
+ .form_group.clearfix
+ = f.label :template_project, class: 'label-light' do
+ Start from template
+ .col-sm-12.import-buttons
+ = render 'project_templates', f: f
- if import_sources_enabled?
.project-import.js-toggle-container
.form-group.clearfix
- = f.label :visibility_level, class: 'label-light' do
+ = f.label :visibility_level, class: 'label-light' do #the label here seems wrong
Import project from
.col-sm-12.import-buttons
%div
@@ -90,6 +71,32 @@
.js-toggle-content.hide
= render "shared/import_form", f: f
+ .row
+ .form-group.col-xs-12.col-sm-6
+ = f.label :namespace_id, class: 'label-light' do
+ %span
+ Project path
+ .form-group
+ .input-group
+ - if current_user.can_select_namespace?
+ .input-group-addon
+ = root_url
+ = f.select :namespace_id, namespaces_options(namespace_id_from(params) || :current_user, display_path: true, extra_group: namespace_id_from(params)), {}, { class: 'select2 js-select-namespace', tabindex: 1}
+
+ - else
+ .input-group-addon.static-namespace
+ #{root_url}#{current_user.username}/
+ = f.hidden_field :namespace_id, value: current_user.namespace_id
+ .form-group.col-xs-12.col-sm-6.project-path
+ = f.label :path, class: 'label-light' do
+ %span
+ Project name
+ = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, autofocus: true, required: true
+ - if current_user.can_create_group?
+ .help-block
+ Want to house several dependent projects under the same namespace?
+ = link_to "Create a group", new_group_path
+
.form-group
= f.label :description, class: 'label-light' do
Project description