summaryrefslogtreecommitdiff
path: root/app/views/projects/_import_project_pane.html.haml
blob: b5678b56ca6d841555ba847bc478b51fd77d5738 (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
- active_tab = local_assigns.fetch(:active_tab, 'blank')
- track_label = local_assigns.fetch(:track_label, 'import_project')

.project-import
  .form-group.import-btn-container.clearfix
    %h5
      Import project from
    .import-buttons
      - if gitlab_project_import_enabled?
        .import_gitlab_project.has-tooltip{ data: { container: 'body' } }
          = link_to new_import_gitlab_project_path, class: 'btn btn_import_gitlab_project project-submit', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "gitlab_export" } do
            = icon('gitlab', text: 'GitLab export')

      - if github_import_enabled?
        %div
          = link_to new_import_github_path, class: 'btn js-import-github', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "github" } do
            = icon('github', text: 'GitHub')

      - if bitbucket_import_enabled?
        %div
          = link_to status_import_bitbucket_path, class: "btn import_bitbucket #{'how_to_import_link' unless bitbucket_import_configured?}",
          data: { track_label: "#{track_label}", track_event: "click_button", track_property: "bitbucket_cloud" } do
            = icon('bitbucket', text: 'Bitbucket Cloud')
          - unless bitbucket_import_configured?
            = render 'bitbucket_import_modal'
      - if bitbucket_server_import_enabled?
        %div
          = link_to status_import_bitbucket_server_path, class: "btn import_bitbucket",
          data: { track_label: "#{track_label}", track_event: "click_button", track_property: "bitbucket_server" } do
            = icon('bitbucket-square', text: 'Bitbucket Server')
        %div
      - if gitlab_import_enabled?
        %div
          = link_to status_import_gitlab_path, class: "btn import_gitlab #{'how_to_import_link' unless gitlab_import_configured?}",
          data: { track_label: "#{track_label}", track_event: "click_button", track_property: "gitlab_com" } do
            = icon('gitlab', text: 'GitLab.com')
          - unless gitlab_import_configured?
            = render 'gitlab_import_modal'

      - if google_code_import_enabled?
        %div
          = link_to new_import_google_code_path, class: 'btn import_google_code', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "google_code" } do
            = icon('google', text: 'Google Code')

      - if fogbugz_import_enabled?
        %div
          = link_to new_import_fogbugz_path, class: 'btn import_fogbugz', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "fogbugz" } do
            = icon('bug', text: 'Fogbugz')

      - if gitea_import_enabled?
        %div
          = link_to new_import_gitea_path, class: 'btn import_gitea', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "gitea" } do
            = custom_icon('gitea_logo')
            Gitea

      - if git_import_enabled?
        %div
          %button.btn.js-toggle-button.js-import-git-toggle-button{ type: "button", data: { toggle_open_class: 'active', data: { toggle_open_class: 'active', track_label: "#{track_label}" , track_event: "click_button", track_property: "repo_url" } } }
            = icon('git', text: 'Repo by URL')

      - if manifest_import_enabled?
        %div
          = link_to new_import_manifest_path, class: 'btn import_manifest', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "manifest_file" } do
            = icon('file-text-o', text: 'Manifest file')

      - if phabricator_import_enabled?
        %div
          = link_to new_import_phabricator_path, class: 'btn import_phabricator', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "phabricator" } do
            = custom_icon('issues')
            = _("Phabricator Tasks")


  .js-toggle-content.toggle-import-form{ class: ('hide' if active_tab != 'import') }
    = form_for @project, html: { class: 'new_project' } do |f|
      %hr
      = render "shared/import_form", f: f
      = render 'new_project_fields', f: f, project_name_id: "import-url-name", hide_init_with_readme: true, track_label: track_label