new.html.haml 4.5 KB
Newer Older
D
Dmitriy Zaporozhets 已提交
1
.project-edit-container
2
  .project-edit-errors
3
    = render 'projects/errors'
4
  .project-edit-content
5

6
    = form_for @project, html: { class: 'new_project form-horizontal' } do |f|
D
Dmitriy Zaporozhets 已提交
7
      .form-group.project-name-holder
8
        = f.label :path, class: 'control-label' do
9
          %strong Project path
D
Dmitriy Zaporozhets 已提交
10
        .col-sm-10
11 12 13 14
          .input-group
            = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 1, autofocus: true
            .input-group-addon
              \.git
15 16

      - if current_user.can_select_namespace?
D
Dmitriy Zaporozhets 已提交
17
        .form-group
18
          = f.label :namespace_id, class: 'control-label' do
19
            %span Namespace
D
Dmitriy Zaporozhets 已提交
20
          .col-sm-10
21
            = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'select2', tabindex: 2}
22

23
      %hr
24 25

      .project-import.js-toggle-container
26
        .form-group
27
          %label.control-label Import project from
28
          .col-sm-10
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
            - if github_import_enabled?
              = link_to status_import_github_path, class: 'btn' do
                %i.fa.fa-github
                GitHub
            - else
              = link_to '#', class: 'how_to_import_link light btn' do
                %i.fa.fa-github
                GitHub
              = render 'github_import_modal'


            - if bitbucket_import_enabled?
              = link_to status_import_bitbucket_path, class: 'btn' do
                %i.fa.fa-bitbucket
                Bitbucket
            - else
              = link_to '#', class: 'how_to_import_link light btn' do
                %i.fa.fa-bitbucket
                Bitbucket
              = render 'bitbucket_import_modal'

            - unless request.host == 'gitlab.com'
              - if gitlab_import_enabled?
                = link_to status_import_gitlab_path, class: 'btn' do
                  %i.fa.fa-heart
                  GitLab.com
              - else
                = link_to '#', class: 'how_to_import_link light btn' do
                  %i.fa.fa-heart
                  GitLab.com
                = render 'gitlab_import_modal'

            = link_to new_import_gitorious_path, class: 'btn' do
              %i.icon-gitorious.icon-gitorious-small
              Gitorious.org

            = link_to "#", class: 'btn js-toggle-button' do
              %i.fa.fa-git
D
Douwe Maan 已提交
67
              %span Any repo by URL
68

69 70 71
        .js-toggle-content.hide
          .form-group.import-url-data
            = f.label :import_url, class: 'control-label' do
72
              %span Git repository URL
73
            .col-sm-10
D
Douwe Maan 已提交
74
              = f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
75
              .alert.alert-info.prepend-top-10
D
Douwe Maan 已提交
76
                %ul
77
                  %li
D
Douwe Maan 已提交
78
                    The repository must be accessible over HTTP(S). If it is not publicly accessible, you can add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>.
79
                  %li
D
Douwe Maan 已提交
80 81 82
                    The import will time out after 4 minutes. For big repositories, use a clone/push combination.
                  %li
                    To migrate an SVN repository, check out #{link_to "this document", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}.
D
Dmitriy Zaporozhets 已提交
83

V
Valery Sizov 已提交
84
      %hr.prepend-botton-10
85

D
Dmitriy Zaporozhets 已提交
86
      .form-group
87
        = f.label :description, class: 'control-label' do
88 89
          Description
          %span.light (optional)
D
Dmitriy Zaporozhets 已提交
90
        .col-sm-10
91
          = f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250, tabindex: 3
92
      = render "visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
93

D
Dmitriy Zaporozhets 已提交
94 95
      .form-actions
        = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
96

D
Dmitriy Zaporozhets 已提交
97 98
        - if current_user.can_create_group?
          .pull-right
99
            .light
D
Dmitriy Zaporozhets 已提交
100
              Need a group for several dependent projects?
D
Dmitriy Zaporozhets 已提交
101
              = link_to new_group_path, class: "btn btn-xs" do
D
Dmitriy Zaporozhets 已提交
102
                Create a group
103

104
.save-project-loader.hide
105
  .center
106
    %h2
S
Sullivan SENECHAL 已提交
107
      %i.fa.fa-spinner.fa-spin
108
      Creating project &amp; repository.
D
Dmitriy Zaporozhets 已提交
109
    %p Please wait a moment, this page will automatically refresh when ready.
V
Valery Sizov 已提交
110 111 112 113 114

:coffeescript
  $ ->
    $('.how_to_import_link').bind 'click', (e) ->
      e.preventDefault()
115
      import_modal = $(this).next(".modal").show()
V
Valery Sizov 已提交
116
    $('.modal-header .close').bind 'click', ->
117
      $(".modal").hide()