2018-03-17 18:26:18 +05:30
|
|
|
|
- visibility_level = params.dig(:project, :visibility_level) || default_project_visibility
|
2018-03-27 19:54:05 +05:30
|
|
|
|
- ci_cd_only = local_assigns.fetch(:ci_cd_only, false)
|
2018-12-05 23:21:45 +05:30
|
|
|
|
- hide_init_with_readme = local_assigns.fetch(:hide_init_with_readme, false)
|
|
|
|
|
- track_label = local_assigns.fetch(:track_label, 'blank_project')
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
|
|
.row{ id: project_name_id }
|
2018-03-27 19:54:05 +05:30
|
|
|
|
= f.hidden_field :ci_cd_only, value: ci_cd_only
|
2018-11-20 20:47:30 +05:30
|
|
|
|
.form-group.project-name.col-sm-12
|
|
|
|
|
= f.label :name, class: 'label-bold' do
|
|
|
|
|
%span= _("Project name")
|
2018-12-05 23:21:45 +05:30
|
|
|
|
= f.text_field :name, placeholder: "My awesome project", class: "form-control input-lg", autofocus: true, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_name", track_value: "" }
|
2018-03-17 18:26:18 +05:30
|
|
|
|
.form-group.project-path.col-sm-6
|
2018-11-18 11:00:15 +05:30
|
|
|
|
= f.label :namespace_id, class: 'label-bold' do
|
2018-11-20 20:47:30 +05:30
|
|
|
|
%span= s_("Project URL")
|
2019-07-07 11:18:12 +05:30
|
|
|
|
.input-group.flex-nowrap
|
2018-03-17 18:26:18 +05:30
|
|
|
|
- if current_user.can_select_namespace?
|
2019-07-07 11:18:12 +05:30
|
|
|
|
.input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url }
|
2018-11-08 19:23:39 +05:30
|
|
|
|
.input-group-text
|
|
|
|
|
= root_url
|
2018-11-18 11:00:15 +05:30
|
|
|
|
- namespace_id = namespace_id_from(params)
|
|
|
|
|
= f.select(:namespace_id,
|
2019-07-07 11:18:12 +05:30
|
|
|
|
namespaces_options_with_developer_maintainer_access(selected: namespace_id,
|
|
|
|
|
display_path: true,
|
|
|
|
|
extra_group: namespace_id),
|
2018-11-18 11:00:15 +05:30
|
|
|
|
{},
|
2019-07-07 11:18:12 +05:30
|
|
|
|
{ class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', tabindex: 1, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "" }})
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
|
|
- else
|
2019-07-07 11:18:12 +05:30
|
|
|
|
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
|
2018-11-08 19:23:39 +05:30
|
|
|
|
.input-group-text.border-0
|
|
|
|
|
#{user_url(current_user.username)}/
|
2018-03-17 18:26:18 +05:30
|
|
|
|
= f.hidden_field :namespace_id, value: current_user.namespace_id
|
|
|
|
|
.form-group.project-path.col-sm-6
|
2018-11-18 11:00:15 +05:30
|
|
|
|
= f.label :path, class: 'label-bold' do
|
2018-11-20 20:47:30 +05:30
|
|
|
|
%span= _("Project slug")
|
2018-12-13 13:39:08 +05:30
|
|
|
|
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control", required: true
|
2018-03-17 18:26:18 +05:30
|
|
|
|
- if current_user.can_create_group?
|
2018-11-08 19:23:39 +05:30
|
|
|
|
.form-text.text-muted
|
2018-03-17 18:26:18 +05:30
|
|
|
|
Want to house several dependent projects under the same namespace?
|
2018-11-20 20:47:30 +05:30
|
|
|
|
= link_to "Create a group.", new_group_path
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
|
|
.form-group
|
2018-11-18 11:00:15 +05:30
|
|
|
|
= f.label :description, class: 'label-bold' do
|
2018-03-17 18:26:18 +05:30
|
|
|
|
Project description
|
|
|
|
|
%span (optional)
|
2019-03-02 22:35:43 +05:30
|
|
|
|
= f.text_area :description, placeholder: 'Description format', class: "form-control", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_description", track_value: "" }
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
2018-11-18 11:00:15 +05:30
|
|
|
|
= f.label :visibility_level, class: 'label-bold' do
|
2018-11-08 19:23:39 +05:30
|
|
|
|
Visibility Level
|
|
|
|
|
= link_to icon('question-circle'), help_page_path("public_access/public_access"), aria: { label: 'Documentation for Visibility Level' }, target: '_blank', rel: 'noopener noreferrer'
|
|
|
|
|
= render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false
|
|
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
|
- if !hide_init_with_readme
|
|
|
|
|
.form-group.row.initialize-with-readme-setting
|
|
|
|
|
%div{ :class => "col-sm-12" }
|
|
|
|
|
.form-check
|
|
|
|
|
= check_box_tag 'project[initialize_with_readme]', '1', false, class: 'form-check-input', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "init_with_readme" }
|
|
|
|
|
= label_tag 'project[initialize_with_readme]', class: 'form-check-label' do
|
|
|
|
|
.option-title
|
|
|
|
|
%strong Initialize repository with a README
|
|
|
|
|
.option-description
|
|
|
|
|
Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
|
= f.submit 'Create project', class: "btn btn-success project-submit", data: { track_label: "#{track_label}", track_event: "click_button", track_property: "create_project", track_value: "" }
|
2018-12-05 23:21:45 +05:30
|
|
|
|
= link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "cancel" }
|