new.html.haml 3.9 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 24 25 26 27 28
      %hr
      .js-toggle-container
        .form-group
          .col-sm-2
          .col-sm-10
            = link_to "#", class: 'js-toggle-button' do
S
Sullivan SENECHAL 已提交
29
              %i.fa.fa-upload
D
Dmitriy Zaporozhets 已提交
30
              %span Import existing repository by URL
31 32 33
        .js-toggle-content.hide
          .form-group.import-url-data
            = f.label :import_url, class: 'control-label' do
34
              %span Import existing git repo
35 36
            .col-sm-10
              = f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git'
37
              .bs-callout.bs-callout-info
B
Ben Bodenmiller 已提交
38
                This URL must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
39
                %br
40
                The import will time out after 4 minutes. For big repositories, use a clone/push combination.
41
                For SVN repositories, check #{link_to "this migrating from SVN doc.", "http://doc.gitlab.com/ce/workflow/migrating_from_svn.html"}
D
Dmitriy Zaporozhets 已提交
42

43 44 45 46
      .project-import.form-group
        .col-sm-2
        .col-sm-10
          - if github_import_enabled?
47
            = link_to status_import_github_path do
D
Dmitriy Zaporozhets 已提交
48 49
              %i.fa.fa-github
              Import projects from GitHub
50 51 52 53 54
          - else
            = link_to '#', class: 'how_to_import_link light' do
              %i.fa.fa-github
              Import projects from GitHub
            = render 'github_import_modal'
V
Valery Sizov 已提交
55 56 57 58 59
      
      .project-import.form-group
        .col-sm-2
        .col-sm-10
          - if gitlab_import_enabled?
60
            = link_to status_import_gitlab_path do
V
Valery Sizov 已提交
61 62 63 64 65 66 67
              %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'
V
Valery Sizov 已提交
68 69

      %hr.prepend-botton-10
70

D
Dmitriy Zaporozhets 已提交
71
      .form-group
72
        = f.label :description, class: 'control-label' do
73 74
          Description
          %span.light (optional)
D
Dmitriy Zaporozhets 已提交
75
        .col-sm-10
76
          = f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250, tabindex: 3
77
      = render "visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
78

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

D
Dmitriy Zaporozhets 已提交
82 83
        - if current_user.can_create_group?
          .pull-right
84
            .light
D
Dmitriy Zaporozhets 已提交
85 86 87
              Need a group for several dependent projects?
              = link_to new_group_path, class: "btn btn-tiny" do
                Create a group
88

89
.save-project-loader.hide
90
  .center
91
    %h2
S
Sullivan SENECHAL 已提交
92
      %i.fa.fa-spinner.fa-spin
93
      Creating project & repository.
D
Dmitriy Zaporozhets 已提交
94
    %p Please wait a moment, this page will automatically refresh when ready.
V
Valery Sizov 已提交
95 96 97 98 99 100 101 102

:coffeescript
  $ ->
    $('.how_to_import_link').bind 'click', (e) ->
      e.preventDefault()
      import_modal = $(this).parent().find(".modal").show()
    $('.modal-header .close').bind 'click', ->
      $(".modal").hide()