2019-05-26 01:42:42 -04:00
- visibility_level = selected_visibility_level(@project, params.dig(:project, :visibility_level))
2018-02-20 21:23:49 -05:00
- ci_cd_only = local_assigns.fetch(:ci_cd_only, false)
2018-09-13 07:39:07 -04:00
- hide_init_with_readme = local_assigns.fetch(:hide_init_with_readme, false)
2018-10-03 14:00:22 -04:00
- track_label = local_assigns.fetch(:track_label, 'blank_project')
2017-10-11 05:07:19 -04:00
.row{ id: project_name_id }
2018-02-20 21:23:49 -05:00
= f.hidden_field :ci_cd_only, value: ci_cd_only
2018-09-08 02:03:00 -04:00
.form-group.project-name.col-sm-12
= f.label :name, class: 'label-bold' do
%span= _("Project name")
2018-10-03 14:00:22 -04:00
= 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: "" }
2017-10-11 05:07:19 -04:00
.form-group.project-path.col-sm-6
2018-07-19 18:11:31 -04:00
= f.label :namespace_id, class: 'label-bold' do
2018-09-08 02:03:00 -04:00
%span= s_("Project URL")
2019-03-19 16:11:41 -04:00
.input-group.flex-nowrap
2017-10-11 05:07:19 -04:00
- if current_user.can_select_namespace?
2019-03-19 16:11:41 -04:00
.input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url }
2018-04-12 16:32:55 -04:00
.input-group-text
= root_url
2018-08-06 11:00:51 -04:00
- namespace_id = namespace_id_from(params)
= f.select(:namespace_id,
2019-04-05 14:49:46 -04:00
namespaces_options_with_developer_maintainer_access(selected: namespace_id,
display_path: true,
extra_group: namespace_id),
2018-08-06 11:00:51 -04:00
{},
2020-06-12 08:08:56 -04:00
{ class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "" }})
2017-10-11 05:07:19 -04:00
- else
2019-03-19 16:11:41 -04:00
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
2018-06-15 11:33:30 -04:00
.input-group-text.border-0
2018-04-12 16:32:55 -04:00
#{user_url(current_user.username)}/
2017-10-11 05:07:19 -04:00
= f.hidden_field :namespace_id, value: current_user.namespace_id
.form-group.project-path.col-sm-6
2018-07-19 18:11:31 -04:00
= f.label :path, class: 'label-bold' do
2018-09-08 02:03:00 -04:00
%span= _("Project slug")
2018-10-08 13:08:45 -04:00
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control", required: true
2017-10-11 05:07:19 -04:00
- if current_user.can_create_group?
2018-04-11 14:26:37 -04:00
.form-text.text-muted
2019-07-10 06:25:43 -04: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
2017-10-11 05:07:19 -04:00
.form-group
2018-07-19 18:11:31 -04:00
= f.label :description, class: 'label-bold' do
2019-07-10 06:25:43 -04:00
= s_('ProjectsNew|Project description %{tag_start}(optional)%{tag_end}').html_safe % { tag_start: '<span>'.html_safe, tag_end: '</span>'.html_safe }
= f.text_area :description, placeholder: s_('ProjectsNew|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: "" }
2017-10-11 05:07:19 -04:00
2018-07-19 18:11:31 -04:00
= f.label :visibility_level, class: 'label-bold' do
2019-07-10 06:25:43 -04:00
= s_('ProjectsNew|Visibility Level')
2020-09-11 14:08:42 -04: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'
2018-05-29 14:07:28 -04:00
= render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false
2017-10-11 05:07:19 -04:00
2018-09-13 07:39:07 -04:00
- if !hide_init_with_readme
.form-group.row.initialize-with-readme-setting
%div{ :class => "col-sm-12" }
.form-check
2019-07-16 08:44:15 -04:00
= check_box_tag 'project[initialize_with_readme]', '1', false, class: 'form-check-input qa-initialize-with-readme-checkbox', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "init_with_readme", track_value: "" }
2018-09-13 07:39:07 -04:00
= label_tag 'project[initialize_with_readme]', class: 'form-check-label' do
.option-title
2019-07-10 06:25:43 -04:00
%strong= s_('ProjectsNew|Initialize repository with a README')
2018-09-13 07:39:07 -04:00
.option-description
2019-07-10 06:25:43 -04:00
= s_('ProjectsNew|Allows you to immediately clone this project’ s repository. Skip this if you plan to push up an existing repository.')
2018-07-03 09:09:58 -04:00
2019-07-10 06:25:43 -04:00
= 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: "" }
2019-07-16 08:44:15 -04:00
= link_to _('Cancel'), dashboard_projects_path, class: 'btn btn-cancel', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "cancel", track_value: "" }