2019-05-26 05:42:42 +00:00
- visibility_level = selected_visibility_level(@project, params.dig(:project, :visibility_level))
2018-02-21 02:23:49 +00:00
- ci_cd_only = local_assigns.fetch(:ci_cd_only, false)
2018-09-13 11:39:07 +00:00
- hide_init_with_readme = local_assigns.fetch(:hide_init_with_readme, false)
2018-10-03 18:00:22 +00:00
- track_label = local_assigns.fetch(:track_label, 'blank_project')
2017-10-11 09:07:19 +00:00
.row{ id: project_name_id }
2018-02-21 02:23:49 +00:00
= f.hidden_field :ci_cd_only, value: ci_cd_only
2018-09-08 06:03:00 +00:00
.form-group.project-name.col-sm-12
= f.label :name, class: 'label-bold' do
%span= _("Project name")
2022-03-09 06:07:38 +00:00
= f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", data: { qa_selector: 'project_name', track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true }
2022-03-30 18:08:19 +00:00
.form-group.project-path.col-sm-6.gl-pr-0
2018-07-19 22:11:31 +00:00
= f.label :namespace_id, class: 'label-bold' do
2021-08-30 12:09:48 +00:00
%span= _('Project URL')
2021-04-13 18:11:28 +00:00
.input-group.gl-flex-nowrap
2017-10-11 09:07:19 +00:00
- if current_user.can_select_namespace?
2018-08-06 15:00:51 +00:00
- namespace_id = namespace_id_from(params)
2022-03-30 18:08:19 +00:00
.js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path || @current_user_group&.full_path,
namespace_id: namespace_id || @current_user_group&.id,
2022-01-17 03:13:42 +00:00
root_url: root_url,
track_label: track_label,
user_namespace_id: current_user.namespace.id } }
2017-10-11 09:07:19 +00:00
- else
2019-03-19 20:11:41 +00:00
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
2018-06-15 15:33:30 +00:00
.input-group-text.border-0
2018-04-12 20:32:55 +00:00
#{user_url(current_user.username)}/
2017-10-11 09:07:19 +00:00
= f.hidden_field :namespace_id, value: current_user.namespace_id
2022-03-30 18:08:19 +00:00
.gl-align-self-center.gl-pl-5 /
2017-10-11 09:07:19 +00:00
.form-group.project-path.col-sm-6
2018-07-19 22:11:31 +00:00
= f.label :path, class: 'label-bold' do
2018-09-08 06:03:00 +00:00
%span= _("Project slug")
2022-03-09 06:07:38 +00:00
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control gl-form-input", required: true, aria: { required: true }, data: { qa_selector: 'project_path', username: current_user.username }
2022-03-30 18:08:19 +00:00
.js-group-namespace-error.form-text.gl-text-red-500.gl-display-none
= s_('ProjectsNew|Pick a group or namespace where you want to create this project.')
2017-10-11 09:07:19 +00:00
- if current_user.can_create_group?
2018-04-11 18:26:37 +00:00
.form-text.text-muted
2019-07-10 10:25:43 +00:00
- link_start_group_path = '<a href="%{path}">' % { path: new_group_path }
- project_tip = s_('ProjectsNew|Want to house several dependent projects under the same namespace? %{link_start}Create a group.%{link_end}') % { link_start: link_start_group_path, link_end: '</a>' }
= project_tip.html_safe
2022-04-05 18:09:00 +00:00
= render Pajamas::AlertComponent.new(alert_class: "gl-mb-4 gl-display-none js-user-readme-repo",
dismissible: false,
variant: :success) do
2021-11-11 15:10:57 +00:00
.gl-alert-body
2021-11-25 15:09:54 +00:00
- help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/profile/index', anchor: 'add-details-to-your-profile-with-a-readme') }
2021-11-11 15:10:57 +00:00
= html_escape(_('%{project_path} is a project that you can use to add a README to your GitLab profile. Create a public project and initialize the repository with a README to get started. %{help_link_start}Learn more.%{help_link_end}')) % { project_path: "<strong>#{current_user.username} / #{current_user.username}</strong>".html_safe, help_link_start: help_link_start, help_link_end: '</a>'.html_safe }
2017-10-11 09:07:19 +00:00
.form-group
2018-07-19 22:11:31 +00:00
= f.label :description, class: 'label-bold' do
2019-07-10 10:25:43 +00:00
= s_('ProjectsNew|Project description %{tag_start}(optional)%{tag_end}').html_safe % { tag_start: '<span>'.html_safe, tag_end: '</span>'.html_safe }
2022-03-09 06:07:38 +00:00
= f.text_area :description, placeholder: s_('ProjectsNew|Description format'), class: "form-control gl-form-input", rows: 3, maxlength: 250, data: { qa_selector: 'project_description', track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_description", track_value: "" }
2017-10-11 09:07:19 +00:00
2022-03-14 18:07:46 +00:00
- unless Gitlab::CurrentSettings.current_application_settings.hide_third_party_offers?
.js-deployment-target-select
2022-02-08 00:14:26 +00:00
2018-07-19 22:11:31 +00:00
= f.label :visibility_level, class: 'label-bold' do
2019-07-10 10:25:43 +00:00
= s_('ProjectsNew|Visibility Level')
2020-09-11 18:08:42 +00:00
= link_to sprite_icon('question-o'), help_page_path('public_access/public_access'), aria: { label: 'Documentation for Visibility Level' }, target: '_blank', rel: 'noopener noreferrer'
2022-03-09 06:07:38 +00:00
= render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false, data: { qa_selector: 'visibility_radios'}
2017-10-11 09:07:19 +00:00
2018-09-13 11:39:07 +00:00
- if !hide_init_with_readme
2021-10-07 21:11:49 +00:00
= f.label :project_configuration, class: 'label-bold' do
= s_('ProjectsNew|Project Configuration')
.form-group
.form-check.gl-mb-3
= check_box_tag 'project[initialize_with_readme]', '1', true, class: 'form-check-input', data: { qa_selector: 'initialize_with_readme_checkbox', track_label: track_label, track_action: 'activate_form_input', track_property: 'init_with_readme' }
= label_tag 'project[initialize_with_readme]', s_('ProjectsNew|Initialize repository with a README'), class: 'form-check-label'
.form-text.text-muted
= s_('ProjectsNew|Allows you to immediately clone this project’ s repository. Skip this if you plan to push up an existing repository.')
2022-03-22 18:08:29 +00:00
.form-group
.form-check.gl-mb-3
= check_box_tag 'project[initialize_with_sast]', '1', false, class: 'form-check-input', data: { qa_selector: 'initialize_with_sast_checkbox', track_label: track_label, track_action: 'activate_form_input', track_property: 'init_with_sast' }
= label_tag 'project[initialize_with_sast]', class: 'form-check-label' do
= s_('ProjectsNew|Enable Static Application Security Testing (SAST)')
.form-text.text-muted
= s_('ProjectsNew|Analyze your source code for known security vulnerabilities.')
= link_to _('Learn more.'), help_page_path('user/application_security/sast/index'), target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'followed' }
2018-07-03 13:09:58 +00:00
2022-03-30 18:08:19 +00:00
= f.submit _('Create project'), class: "btn gl-button btn-confirm js-create-project-button", data: { qa_selector: 'project_create_button', track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" }
2021-09-15 18:11:29 +00:00
= link_to _('Cancel'), dashboard_projects_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "cancel", track_value: "" }