summaryrefslogtreecommitdiff
path: root/app/views/projects/new.html.haml
blob: 636218368cc603229f3a658cb07ca9d527061b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
- page_title    'New Project'
- header_title  'New Project'
.project-edit-container
  .project-edit-errors
    = render 'projects/errors'
  .project-edit-content

    = form_for @project, html: { class: 'new_project form-horizontal js-requires-input' } 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, required: 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}

      - if import_sources_enabled?
        %hr

        .project-import.js-toggle-container
          .form-group
            %label.control-label Import project from
            .col-sm-10
              - if github_import_enabled?
                - if github_import_configured?
                  = link_to status_import_github_path, class: 'btn import_github' do
                    %i.fa.fa-github
                    GitHub
                - else
                  = link_to '#', class: 'how_to_import_link light btn import_github' do
                    %i.fa.fa-github
                    GitHub
                  = render 'github_import_modal'

              - if bitbucket_import_enabled?
                - if bitbucket_import_configured?
                  = link_to status_import_bitbucket_path, class: 'btn import_bitbucket', "data-no-turbolink" => "true" do
                    %i.fa.fa-bitbucket
                    Bitbucket
                - else
                  = link_to status_import_bitbucket_path, class: 'how_to_import_link light btn import_bitbucket', "data-no-turbolink" => "true" do
                    %i.fa.fa-bitbucket
                    Bitbucket
                  = render 'bitbucket_import_modal'

              - if gitlab_import_enabled?
                - if gitlab_import_configured?
                  = link_to status_import_gitlab_path, class: 'btn import_gitlab' do
                    %i.fa.fa-heart
                    GitLab.com
                - else
                  = link_to status_import_gitlab_path, class: 'how_to_import_link light btn import_gitlab' do
                    %i.fa.fa-heart
                    GitLab.com
                  = render 'gitlab_import_modal'

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

              - if google_code_import_enabled?
                = link_to new_import_google_code_path, class: 'btn import_google_code' do
                  %i.fa.fa-google
                  Google Code

              - if git_import_enabled?
                = link_to "#", class: 'btn js-toggle-button import_git' do
                  %i.fa.fa-git
                  %span Any repo by URL

          .js-toggle-content.hide
            .form-group.import-url-data
              = f.label :import_url, class: 'control-label' do
                %span Git repository URL
              .col-sm-10
                = f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
                .well.prepend-top-20
                  %ul
                    %li
                      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>.
                    %li
                      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/importing/migrating_from_svn.html"}.

      %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 'shared/visibility_level', f: f, visibility_level: default_project_visibility, can_change_visibility_level: true, form_model: @project

      .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-xs" do
                Create a group

.save-project-loader.hide
  .center
    %h2
      %i.fa.fa-spinner.fa-spin
      Creating project &amp; 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).next(".modal").show()
  $('.modal-header .close').bind 'click', ->
    $(".modal").hide()