gitlab-org--gitlab-foss/app/views/projects/new.html.haml
2015-03-07 00:28:53 -08:00

123 lines
4.6 KiB
Text

.project-edit-container
.project-edit-errors
= render 'projects/errors'
.project-edit-content
= form_for @project, html: { class: 'new_project form-horizontal' } do |f|
.form-group.project-name-holder
= f.label :path, class: 'control-label' do
%strong Project path
.col-sm-10
.input-group
= f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true
.input-group-addon
\.git
- if current_user.can_select_namespace?
.form-group
= f.label :namespace_id, class: 'control-label' do
%span Namespace
.col-sm-10
= f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2}
%hr
.js-toggle-container
.form-group
.col-sm-2
.col-sm-10
= link_to "#", class: 'js-toggle-button' do
%i.fa.fa-upload
%span Import existing repository by URL
.js-toggle-content.hide
.form-group.import-url-data
= f.label :import_url, class: 'control-label' do
%span Import existing git repo
.col-sm-10
= f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git'
.alert.alert-info.prepend-top-10
This URL must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
%br
The import will time out after 4 minutes. For big repositories, use a clone/push combination.
For SVN repositories, check #{link_to "this migrating from SVN doc.", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}
.project-import.form-group
.col-sm-2
.col-sm-10
- if github_import_enabled?
= link_to status_import_github_path do
%i.fa.fa-github
Import projects from GitHub
- else
= link_to '#', class: 'how_to_import_link light' do
%i.fa.fa-github
Import projects from GitHub
= render 'github_import_modal'
.project-import.form-group
.col-sm-2
.col-sm-10
- if bitbucket_import_enabled?
= link_to status_import_bitbucket_path do
%i.fa.fa-bitbucket
Import projects from Bitbucket
- else
= link_to '#', class: 'how_to_import_link light' do
%i.fa.fa-bitbucket
Import projects from Bitbucket
= render 'bitbucket_import_modal'
- unless request.host == 'gitlab.com'
.project-import.form-group
.col-sm-2
.col-sm-10
- if gitlab_import_enabled?
= link_to status_import_gitlab_path do
%i.fa.fa-heart
Import projects from GitLab.com
- else
= link_to '#', class: 'how_to_import_link light' do
%i.fa.fa-heart
Import projects from GitLab.com
= render 'gitlab_import_modal'
.project-import.form-group
.col-sm-2
.col-sm-10
= link_to new_import_gitorious_path do
%i.icon-gitorious.icon-gitorious-small
Import projects from Gitorious.org
%hr.prepend-botton-10
.form-group
= f.label :description, class: 'control-label' do
Description
%span.light (optional)
.col-sm-10
= f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250, tabindex: 3
= render "visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
.form-actions
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
- if current_user.can_create_group?
.pull-right
.light
Need a group for several dependent projects?
= link_to new_group_path, class: "btn btn-tiny" do
Create a group
.save-project-loader.hide
.center
%h2
%i.fa.fa-spinner.fa-spin
Creating project & repository.
%p Please wait a moment, this page will automatically refresh when ready.
:coffeescript
$ ->
$('.how_to_import_link').bind 'click', (e) ->
e.preventDefault()
import_modal = $(this).parent().find(".modal").show()
$('.modal-header .close').bind 'click', ->
$(".modal").hide()